mirror of
https://github.com/darksaid98/Builders-Utilities.git
synced 2026-12-01 14:38:46 +00:00
update
update
This commit is contained in:
1 parent
009927e4f4
commit
04883a7da2
3 files changed
+25
-25
No files matched your search
@@ -36,13 +36,14 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class Main extends JavaPlugin implements Listener {
|
||||
public static Main main;
|
||||
public static NmsManager nmsManager;
|
||||
public static List<String> ironTrapdoorNames;
|
||||
public static List<String> slabNames;
|
||||
public static List<String> terracottaNames;
|
||||
public static Main main;
|
||||
|
||||
public void onEnable() {
|
||||
main = this;
|
||||
nmsManager = new NmsManager();
|
||||
|
||||
PluginManager pm = getServer().getPluginManager();
|
||||
@@ -52,8 +53,6 @@ public class Main extends JavaPlugin implements Listener {
|
||||
slabNames = new ArrayList<>();
|
||||
terracottaNames = new ArrayList<>();
|
||||
|
||||
main = this;
|
||||
|
||||
this.saveDefaultConfig();
|
||||
new NoClipManager(this);
|
||||
|
||||
@@ -133,6 +132,9 @@ public class Main extends JavaPlugin implements Listener {
|
||||
|
||||
@EventHandler(priority = EventPriority.MONITOR)
|
||||
public void onDragonEggTP(PlayerInteractEvent e) {
|
||||
if (e.isCancelled()){
|
||||
return;
|
||||
}
|
||||
if (e.getAction().equals(Action.RIGHT_CLICK_BLOCK) && e.getClickedBlock().getType().equals(Material.DRAGON_EGG) && this.getConfig().getBoolean("prevent-dragon-egg-teleport")) {
|
||||
e.setCancelled(true);
|
||||
}
|
||||
@@ -142,6 +144,9 @@ public class Main extends JavaPlugin implements Listener {
|
||||
@EventHandler(priority = EventPriority.MONITOR)
|
||||
public void onBlockBreak(PlayerInteractEvent e)
|
||||
{
|
||||
if (e.isCancelled()){
|
||||
return;
|
||||
}
|
||||
if (slabNames.contains(e.getPlayer().getName())){
|
||||
return;
|
||||
}
|
||||
@@ -240,6 +245,9 @@ public class Main extends JavaPlugin implements Listener {
|
||||
@SuppressWarnings("deprecation")
|
||||
@EventHandler
|
||||
public void onPlayerInteract(PlayerInteractEvent e) {
|
||||
if (e.isCancelled()){
|
||||
return;
|
||||
}
|
||||
if (this.getConfig().getBoolean("disable-soil-trample")) {
|
||||
if (e.getAction() == Action.PHYSICAL) {
|
||||
Block block = e.getClickedBlock();
|
||||
@@ -286,6 +294,9 @@ public class Main extends JavaPlugin implements Listener {
|
||||
|
||||
@EventHandler
|
||||
public void onTeleport(PlayerTeleportEvent event) {
|
||||
if (event.isCancelled()) {
|
||||
return;
|
||||
}
|
||||
if (event.getCause() == null) {
|
||||
return;
|
||||
}
|
||||
@@ -299,19 +310,19 @@ public class Main extends JavaPlugin implements Listener {
|
||||
@SuppressWarnings("deprecation")
|
||||
@EventHandler(priority = EventPriority.MONITOR)
|
||||
public void GlazedTerracottaInteract(final PlayerInteractEvent e) {
|
||||
if (!Main.nmsManager.isAtLeastVersion(1, 12 ,0)){
|
||||
if (e.isCancelled()) {
|
||||
return;
|
||||
}
|
||||
if (!e.getHand().equals(EquipmentSlot.HAND)) {
|
||||
if (!Main.nmsManager.isAtLeastVersion(1, 12 ,0)){
|
||||
return;
|
||||
}
|
||||
if (!terracottaNames.contains(e.getPlayer().getName())) {
|
||||
return;
|
||||
}
|
||||
if (e.isCancelled()) {
|
||||
if (!e.getAction().equals(Action.RIGHT_CLICK_BLOCK)) {
|
||||
return;
|
||||
}
|
||||
if (!e.getAction().equals(Action.RIGHT_CLICK_BLOCK)) {
|
||||
if (!e.getHand().equals(EquipmentSlot.HAND)) {
|
||||
return;
|
||||
}
|
||||
if (!e.getClickedBlock().getType().name().contains("GLAZED")) {
|
||||
@@ -339,15 +350,15 @@ public class Main extends JavaPlugin implements Listener {
|
||||
@SuppressWarnings("deprecation")
|
||||
@EventHandler(priority = EventPriority.MONITOR)
|
||||
public void ironTrapDoorInteract(final PlayerInteractEvent e) {
|
||||
if (e.isCancelled()) {
|
||||
return;
|
||||
}
|
||||
if (ironTrapdoorNames.contains(e.getPlayer().getName())) {
|
||||
return;
|
||||
}
|
||||
if (!e.getPlayer().getGameMode().equals(GameMode.CREATIVE)) {
|
||||
return;
|
||||
}
|
||||
if (e.isCancelled()) {
|
||||
return;
|
||||
}
|
||||
if (!e.getAction().equals(Action.RIGHT_CLICK_BLOCK)) {
|
||||
return;
|
||||
}
|
||||
@@ -362,7 +373,6 @@ public class Main extends JavaPlugin implements Listener {
|
||||
if (e.getPlayer().isSneaking()) {
|
||||
return;
|
||||
}
|
||||
|
||||
Bukkit.getScheduler().runTaskLater(this, new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
|
||||
@@ -13,17 +13,11 @@ public class NmsManager {
|
||||
}
|
||||
|
||||
public boolean isVersion(String v) {
|
||||
if (version.equalsIgnoreCase(v)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
return version.equalsIgnoreCase(v);
|
||||
}
|
||||
|
||||
public boolean isVersion(int gameV, int releaseV, int subReleaseV) {
|
||||
if (version.equalsIgnoreCase("v" + gameV + "_" + releaseV + "_R" + subReleaseV)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
return version.equalsIgnoreCase("v" + gameV + "_" + releaseV + "_R" + subReleaseV);
|
||||
}
|
||||
|
||||
public boolean isAtLeastVersion(int gameV, int releaseV, int subReleaseV) {
|
||||
@@ -42,11 +36,7 @@ public class NmsManager {
|
||||
} else if (release < releaseV) {
|
||||
return false;
|
||||
} else {
|
||||
if (subRelease >= subReleaseV) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
return subRelease >= subReleaseV;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
name: BuildersUtilities
|
||||
main: com.buildersrefuge.utilities.Main
|
||||
version: 1.2.7
|
||||
version: 1.2.9
|
||||
author: Arcaniax
|
||||
commands:
|
||||
banner:
|
||||
|
||||
Reference in new issue
Block a user