Compare commits
5 Commits
e35bc71f96
...
7783101887
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7783101887 | ||
|
|
f616ed5af0 | ||
|
|
a5f59c2399 | ||
|
|
6209b71db4 | ||
|
|
df875406e1 |
20
Jenkinsfile
vendored
Normal file
20
Jenkinsfile
vendored
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
pipeline {
|
||||
agent any
|
||||
stages {
|
||||
stage('Gradle') {
|
||||
steps {
|
||||
sh 'bash gradlew build'
|
||||
}
|
||||
}
|
||||
stage('Archive') {
|
||||
steps {
|
||||
archiveArtifacts artifacts: 'build/libs/', followSymlinks: false
|
||||
}
|
||||
}
|
||||
stage('discord') {
|
||||
steps {
|
||||
discordSend description: "Build: ${BUILD_NUMBER}", showChangeset: true, result: currentBuild.currentResult, title: currentBuild.fullProjectName, webhookURL: env.discordwebhook
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,6 +1,7 @@
|
|||
plugins {
|
||||
id("java")
|
||||
id("maven-publish")
|
||||
id("com.gorylenko.gradle-git-properties") version "2.3.1"
|
||||
}
|
||||
|
||||
group = "com.alttd"
|
||||
|
|
@ -15,6 +16,10 @@ java {
|
|||
}
|
||||
}
|
||||
|
||||
gitProperties {
|
||||
keys = listOf("git.commit.id", "git.commit.time")
|
||||
}
|
||||
|
||||
tasks {
|
||||
withType<JavaCompile> {
|
||||
options.encoding = Charsets.UTF_8.name()
|
||||
|
|
|
|||
|
|
@ -11,6 +11,10 @@ import com.alttd.playerutils.util.Logger;
|
|||
import org.bukkit.plugin.PluginManager;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.util.Properties;
|
||||
|
||||
public final class PlayerUtils extends JavaPlugin {
|
||||
|
||||
private Logger logger;
|
||||
|
|
@ -22,6 +26,20 @@ public final class PlayerUtils extends JavaPlugin {
|
|||
registerCommands();
|
||||
registerEvents();
|
||||
reloadConfigs();
|
||||
printVersion();
|
||||
}
|
||||
|
||||
private void printVersion() {
|
||||
Properties gitProps = new Properties();
|
||||
try (InputStream inputStream = getClass().getClassLoader().getResourceAsStream("git.properties")) {
|
||||
gitProps.load(inputStream);
|
||||
} catch (IOException e) {
|
||||
logger.severe("Unable to load git.properties, unknown version");
|
||||
return;
|
||||
}
|
||||
|
||||
logger.info("Git commit ID: %s".formatted(gitProps.getProperty("git.commit.id")));
|
||||
logger.info("Git commit time: %s".formatted(gitProps.getProperty("git.commit.time")));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -11,8 +11,8 @@ public class Config extends AbstractConfig{
|
|||
|
||||
Config(Logger logger) {
|
||||
super(
|
||||
new File(System.getProperty("user.home") + File.separator
|
||||
+ "share" + File.separator
|
||||
new File(File.separator
|
||||
+ "mnt" + File.separator
|
||||
+ "configs" + File.separator
|
||||
+ "PlayerUtils"),
|
||||
"config.yml", logger);
|
||||
|
|
|
|||
|
|
@ -11,8 +11,8 @@ public class Messages extends AbstractConfig {
|
|||
|
||||
Messages(Logger logger) {
|
||||
super(
|
||||
new File(System.getProperty("user.home") + File.separator
|
||||
+ "share" + File.separator
|
||||
new File(File.separator
|
||||
+ "mnt" + File.separator
|
||||
+ "configs" + File.separator
|
||||
+ "PlayerUtils"),
|
||||
"messages.yml", logger);
|
||||
|
|
|
|||
|
|
@ -55,7 +55,13 @@ public class RotateBlockEvent implements Listener {
|
|||
return;
|
||||
|
||||
Material type = block.getType();
|
||||
if (Tag.STAIRS.isTagged(type)) {
|
||||
if (type.equals(Material.IRON_TRAPDOOR) && event.getAction().isLeftClick()) {
|
||||
event.setCancelled(true);
|
||||
toggleTrapDoor(block, player);
|
||||
} else if (Tag.BIG_DRIPLEAF_PLACEABLE.isTagged(type) && event.getAction().isLeftClick()) {
|
||||
event.setCancelled(true);
|
||||
toggleDripLeaf(block, player);
|
||||
} else if (Tag.STAIRS.isTagged(type)) {
|
||||
event.setCancelled(true);
|
||||
rotateStairs(block, player);
|
||||
} else if (Tag.WALLS.isTagged(type)) {
|
||||
|
|
@ -67,12 +73,6 @@ public class RotateBlockEvent implements Listener {
|
|||
} else if(Tag.RAILS.isTagged(type)) {
|
||||
event.setCancelled(true);
|
||||
toggleRails(block, player);
|
||||
} else if (type.equals(Material.IRON_TRAPDOOR) && event.getAction().isLeftClick()) {
|
||||
event.setCancelled(true);
|
||||
toggleTrapDoor(block, player);
|
||||
} else if (Tag.BIG_DRIPLEAF_PLACEABLE.isTagged(type) && event.getAction().isLeftClick()) {
|
||||
event.setCancelled(true);
|
||||
toggleDripLeaf(block, player);
|
||||
} else if (block.getBlockData() instanceof Directional directional) {
|
||||
event.setCancelled(true);
|
||||
rotateDirectionalBlock(block, directional, player);
|
||||
|
|
@ -94,10 +94,8 @@ public class RotateBlockEvent implements Listener {
|
|||
BigDripleaf.Tilt[] values = BigDripleaf.Tilt.values();
|
||||
|
||||
int ordinal = bigDripleaf.getTilt().ordinal();
|
||||
if (ordinal == values.length) {
|
||||
if (++ordinal == values.length) {
|
||||
ordinal = 0;
|
||||
} else {
|
||||
ordinal++;
|
||||
}
|
||||
|
||||
bigDripleaf.setTilt(values[ordinal]);
|
||||
|
|
|
|||
|
|
@ -18,6 +18,8 @@ public class TeleportEvent implements Listener {
|
|||
Player player = event.getPlayer();
|
||||
if (player.getVehicle() == null)
|
||||
return;
|
||||
if (event.getTo().distance(event.getFrom()) < 5)
|
||||
return;
|
||||
event.setCancelled(true);
|
||||
player.sendRichMessage("<red>Teleporting was cancelled. You can not be sitting, or mounted while teleporting.");
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user