Compare commits

..

No commits in common. "778310188783d1776cbbdcbd6e3f7d8d7484c97b" and "e35bc71f962b694fdd34ec4a982f171f567b8052" have entirely different histories.

7 changed files with 14 additions and 57 deletions

20
Jenkinsfile vendored
View File

@ -1,20 +0,0 @@
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
}
}
}
}

View File

@ -1,7 +1,6 @@
plugins {
id("java")
id("maven-publish")
id("com.gorylenko.gradle-git-properties") version "2.3.1"
}
group = "com.alttd"
@ -16,10 +15,6 @@ java {
}
}
gitProperties {
keys = listOf("git.commit.id", "git.commit.time")
}
tasks {
withType<JavaCompile> {
options.encoding = Charsets.UTF_8.name()

View File

@ -11,10 +11,6 @@ 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;
@ -26,20 +22,6 @@ 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

View File

@ -11,8 +11,8 @@ public class Config extends AbstractConfig{
Config(Logger logger) {
super(
new File(File.separator
+ "mnt" + File.separator
new File(System.getProperty("user.home") + File.separator
+ "share" + File.separator
+ "configs" + File.separator
+ "PlayerUtils"),
"config.yml", logger);

View File

@ -11,8 +11,8 @@ public class Messages extends AbstractConfig {
Messages(Logger logger) {
super(
new File(File.separator
+ "mnt" + File.separator
new File(System.getProperty("user.home") + File.separator
+ "share" + File.separator
+ "configs" + File.separator
+ "PlayerUtils"),
"messages.yml", logger);

View File

@ -55,13 +55,7 @@ public class RotateBlockEvent implements Listener {
return;
Material type = block.getType();
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)) {
if (Tag.STAIRS.isTagged(type)) {
event.setCancelled(true);
rotateStairs(block, player);
} else if (Tag.WALLS.isTagged(type)) {
@ -73,6 +67,12 @@ 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,8 +94,10 @@ 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]);

View File

@ -18,8 +18,6 @@ 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.");
}