Skip to content

Commit

Permalink
1.26.1.2 - Minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
moom0o committed Jun 15, 2022
1 parent a9b650e commit b82a47b
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 17 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>me.moomoo</groupId>
<artifactId>anarchyexploitfixes</artifactId>
<version>1.26.1.1</version>
<version>1.26.1.2</version>
<packaging>jar</packaging>

<name>AnarchyExploitFixes</name>
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/me/moomoo/anarchyexploitfixes/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
23 changes: 12 additions & 11 deletions src/main/java/me/moomoo/anarchyexploitfixes/patches/Elytra.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
7 changes: 5 additions & 2 deletions src/main/resources/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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.

Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/plugin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit b82a47b

Please sign in to comment.