From 421315a31c877707af5016ea775a9cae47b98f3e Mon Sep 17 00:00:00 2001 From: super Date: Thu, 28 Nov 2019 13:21:54 -0500 Subject: [PATCH] revert my changes (#158) --- .../totalfreedommod/TotalFreedomMod.java | 3 - .../blocking/InventoryBlocker.java | 63 ------------------- .../command/Command_toggle.java | 4 +- 3 files changed, 2 insertions(+), 68 deletions(-) delete mode 100644 src/main/java/me/totalfreedom/totalfreedommod/blocking/InventoryBlocker.java diff --git a/src/main/java/me/totalfreedom/totalfreedommod/TotalFreedomMod.java b/src/main/java/me/totalfreedom/totalfreedommod/TotalFreedomMod.java index aa9a6160..48893d42 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/TotalFreedomMod.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/TotalFreedomMod.java @@ -12,7 +12,6 @@ import me.totalfreedom.totalfreedommod.blocking.BlockBlocker; import me.totalfreedom.totalfreedommod.blocking.EditBlocker; import me.totalfreedom.totalfreedommod.blocking.EventBlocker; import me.totalfreedom.totalfreedommod.blocking.InteractBlocker; -import me.totalfreedom.totalfreedommod.blocking.InventoryBlocker; import me.totalfreedom.totalfreedommod.blocking.MobBlocker; import me.totalfreedom.totalfreedommod.blocking.PVPBlocker; import me.totalfreedom.totalfreedommod.blocking.PotionBlocker; @@ -88,7 +87,6 @@ public class TotalFreedomMod extends AeroPlugin public MobBlocker mb; public InteractBlocker ib; public PotionBlocker pb; - public InventoryBlocker inb; public LoginProcess lp; public AntiNuke nu; public AntiSpam as; @@ -196,7 +194,6 @@ public class TotalFreedomMod extends AeroPlugin mb = services.registerService(MobBlocker.class); ib = services.registerService(InteractBlocker.class); pb = services.registerService(PotionBlocker.class); - inb = services.registerService(InventoryBlocker.class); lp = services.registerService(LoginProcess.class); nu = services.registerService(AntiNuke.class); as = services.registerService(AntiSpam.class); diff --git a/src/main/java/me/totalfreedom/totalfreedommod/blocking/InventoryBlocker.java b/src/main/java/me/totalfreedom/totalfreedommod/blocking/InventoryBlocker.java deleted file mode 100644 index 5b1de26f..00000000 --- a/src/main/java/me/totalfreedom/totalfreedommod/blocking/InventoryBlocker.java +++ /dev/null @@ -1,63 +0,0 @@ -package me.totalfreedom.totalfreedommod.blocking; - -import me.totalfreedom.totalfreedommod.FreedomService; -import me.totalfreedom.totalfreedommod.TotalFreedomMod; -import net.minecraft.server.v1_14_R1.NBTTagCompound; -import org.bukkit.Bukkit; -import org.bukkit.Material; -import org.bukkit.craftbukkit.v1_14_R1.inventory.CraftItemStack; -import org.bukkit.entity.Player; -import org.bukkit.inventory.Inventory; -import org.bukkit.inventory.ItemStack; -import org.bukkit.scheduler.BukkitRunnable; -import org.bukkit.scheduler.BukkitTask; - -public class InventoryBlocker extends FreedomService -{ - public InventoryBlocker(TotalFreedomMod plugin) - { - super(plugin); - } - - private BukkitTask inventoryChecker; - - @Override - protected void onStart() - { - inventoryChecker = new BukkitRunnable() - { - @Override - public void run() - { - for (Player player : Bukkit.getOnlinePlayers()) - { - Inventory inv = player.getInventory(); - for (int i = 0; i < inv.getSize(); i++) - { - ItemStack item = inv.getItem(i); - if (item == null) - continue; - if (!item.hasItemMeta()) - continue; - if (item.getType() == Material.JUKEBOX) - { - if (!CraftItemStack.asNMSCopy(item).hasTag()) - continue; - net.minecraft.server.v1_14_R1.ItemStack nmsItem = CraftItemStack.asNMSCopy(item); - NBTTagCompound compound = nmsItem.getTag(); - compound.set("BlockEntityTag", null); - inv.setItem(i, new ItemStack(CraftItemStack.asBukkitCopy(nmsItem))); - } - } - } - } - }.runTaskTimer(plugin, 0L, 1); - } - - @Override - protected void onStop() - { - inventoryChecker.cancel(); - inventoryChecker = null; - } -} diff --git a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_toggle.java b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_toggle.java index 726ced1e..3cf5c05f 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_toggle.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_toggle.java @@ -51,7 +51,7 @@ public class Command_toggle extends FreedomCommand } else if (args[0].equalsIgnoreCase("frostwalk")) { - toggle("Frost walker enchantment is ", ConfigEntry.ALLOW_FROSTWALKER); + toggle("Frost walker enchantment is", ConfigEntry.ALLOW_FROSTWALKER); return true; } else if (args[0].equalsIgnoreCase("fireplace")) @@ -180,7 +180,7 @@ public class Command_toggle extends FreedomCommand } else if (args[0].equalsIgnoreCase("tpronjoin")) { - toggle("The random teleporting of players on join is ", ConfigEntry.ALLOW_TPR_ON_JOIN); + toggle("The random teleporting of players on join is", ConfigEntry.ALLOW_TPR_ON_JOIN); return true; } else