From b82a47bc23462900ece0ec3c30cfce0b25ff36f9 Mon Sep 17 00:00:00 2001 From: moo <48740106+moom0o@users.noreply.github.com> Date: Wed, 15 Jun 2022 05:01:43 -0400 Subject: [PATCH] 1.26.1.2 - Minor fixes --- pom.xml | 2 +- .../me/moomoo/anarchyexploitfixes/Main.java | 2 +- .../anarchyexploitfixes/misc/Commands.java | 2 +- .../anarchyexploitfixes/patches/Elytra.java | 23 ++++++++++--------- src/main/resources/config.yml | 7 ++++-- src/main/resources/plugin.yml | 2 +- 6 files changed, 21 insertions(+), 17 deletions(-) diff --git a/pom.xml b/pom.xml index d9ed9aa29..9520cb697 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ me.moomoo anarchyexploitfixes - 1.26.1.1 + 1.26.1.2 jar AnarchyExploitFixes diff --git a/src/main/java/me/moomoo/anarchyexploitfixes/Main.java b/src/main/java/me/moomoo/anarchyexploitfixes/Main.java index 58d56c521..3d428001d 100644 --- a/src/main/java/me/moomoo/anarchyexploitfixes/Main.java +++ b/src/main/java/me/moomoo/anarchyexploitfixes/Main.java @@ -296,7 +296,7 @@ public void revert(ItemStack item) { } if (getConfig().getBoolean("DataValues.RevertIllegalGoldenApple")) { if (item.getType().name().equals("GOLDEN_APPLE")) { - if (!item.getData().toString().equals("GOLDEN_APPLE(0)") && !item.getData().toString().equals("GOLDEN_APPLE(1)")) { + if (!item.getData().toString().equals("GOLDEN_APPLE(0)") && !item.getData().toString().equals("GOLDEN_APPLE(1)") && !item.getData().toString().equals("GOLDEN_APPLE0")) { item.subtract(item.getAmount()); } } diff --git a/src/main/java/me/moomoo/anarchyexploitfixes/misc/Commands.java b/src/main/java/me/moomoo/anarchyexploitfixes/misc/Commands.java index 270de78e8..677b750c9 100644 --- a/src/main/java/me/moomoo/anarchyexploitfixes/misc/Commands.java +++ b/src/main/java/me/moomoo/anarchyexploitfixes/misc/Commands.java @@ -153,7 +153,7 @@ public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command } } } - sender.sendMessage(ChatColor.WHITE + "Unknown command. Type \"/help\" for help."); + sender.sendMessage("Unknown command. Type \"/help\" for help."); return true; } diff --git a/src/main/java/me/moomoo/anarchyexploitfixes/patches/Elytra.java b/src/main/java/me/moomoo/anarchyexploitfixes/patches/Elytra.java index 1d3a05935..ba4b3a3ae 100644 --- a/src/main/java/me/moomoo/anarchyexploitfixes/patches/Elytra.java +++ b/src/main/java/me/moomoo/anarchyexploitfixes/patches/Elytra.java @@ -218,19 +218,20 @@ public void onOpen(EntityToggleGlideEvent evt) { Player e = (Player) evt.getEntity(); Integer level = levels.get(e.getUniqueId()); if (level != null) { - if (level > plugin.getConfig().getInt("MaxElytraOpensPer10Seconds") && (!plugin.getConfig().getBoolean("OnlyElytraPacketKick"))) { - if (i.getChestplate() != null && i.getChestplate().getType().equals(Material.ELYTRA)) { - ItemStack elytra = i.getChestplate(); - i.setChestplate(null); - evt.getEntity().getWorld().dropItemNaturally(i.getLocation(), elytra); - e.getPlayer().playSound(e.getPlayer().getLocation(), Sound.ENTITY_EXPERIENCE_ORB_PICKUP, 1.0F, 1.0F); - if (plugin.getConfig().getBoolean("ElytraActionBar")) { - e.getPlayer().sendActionBar(ChatColor.DARK_RED + "Please disable packet elytra flight!"); + if (level > plugin.getConfig().getInt("MaxElytraOpensPer10Seconds")) { + if (!plugin.getConfig().getBoolean("OnlyElytraPacketKick")) { + if (i.getChestplate() != null && i.getChestplate().getType().equals(Material.ELYTRA)) { + ItemStack elytra = i.getChestplate(); + i.setChestplate(null); + evt.getEntity().getWorld().dropItemNaturally(i.getLocation(), elytra); + e.getPlayer().playSound(e.getPlayer().getLocation(), Sound.ENTITY_EXPERIENCE_ORB_PICKUP, 1.0F, 1.0F); + if (plugin.getConfig().getBoolean("PacketElytraActionBar.enabled")) { + e.getPlayer().sendActionBar(ChatColor.translateAlternateColorCodes('&', plugin.getConfig().getString("PacketElytraActionBar.message"))); + } } + } else { + e.kickPlayer(ChatColor.translateAlternateColorCodes('&', plugin.getConfig().getString("PacketElytraActionBar.message"))); } - } - if (level > plugin.getConfig().getInt("MaxElytraOpensPer10Seconds") && (plugin.getConfig().getBoolean("OnlyElytraPacketKick"))) { - e.kickPlayer("Please disable packet elytra flight."); } else { levels.merge(e.getUniqueId(), 1, Integer::sum); Bukkit.getServer().getScheduler().runTaskLater(plugin, () -> levels.put(e.getUniqueId(), levels.get(e.getUniqueId()) - 1), 200L); diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index ec2ab8f58..ea58b71d9 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -24,7 +24,7 @@ DataValues: RevertSpecificDataValues: true # Required for rest of config options RevertIllegalGoldenApple: true #Revert golden apples that aren't 0 or 1. SpecificDataValues: # If you want to ban any other data values - - "SuperIllegalItem(0)" # (1) is the data value. For example GOLDEN_APPLE uses (0) for unenchanted and (1) for enchanted. + - "SuperIllegalItem(0)" # (0) is the data value. For example GOLDEN_APPLE uses (0) for unenchanted and (1) for enchanted. - NEWER VERSIONS: It is currently not possible to ban specific data values, ALL DATA VALUES WILL BE 0. RevertUnbreakables: Enabled: true # Revert unbreakable items, items with less than 0 durability will be automatically removed or set to 0 durability, which will break on the next use. Items with higher than max durability will be set to legal maximum durability. EnableWhitelist: false # If enabled, only items in the whitelist will be reverted. @@ -258,7 +258,10 @@ ElytraActionBar: true # Patches the future/rusherhack/kamiblue 2b2t elytra fly exploit PatchPacketElytraFly: false -OnlyElytraPacketKick: false #If enabled, the plugin will not remove elytra from the player, but simply disconnect from the server. If you use this, do not turn off "PatchPacketElytraFly", otherwise it will not work. +OnlyElytraPacketKick: false #If enabled, the plugin will not remove elytra from the player, but simply disconnect from the server. +PacketElytraActionBar: + enabled: false + message: "&cDisable Packet Elytra Fly." # for action bar and kick message # Recommended to not go lower as there could be false positives. MaxElytraOpensPer10Seconds: 25 # Will only allow players to go about 85km/h on kami blue, and won't even work on rusherhack. diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index da51b0cb6..b9cab4404 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -16,6 +16,6 @@ permissions: anarchyexploitfixes.netherroofbypass: description: Bypass nether roof restrictions. (if enabled) anarchyexploitfixes.silentJoin: - description: enable silent join mode + description: enable silent join mode anarchyexploitfixes.silentLeave: description: enable silent join mode \ No newline at end of file