mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2024-11-30 10:05:59 +00:00
revert my changes (#158)
This commit is contained in:
parent
0ab0ca2c66
commit
421315a31c
@ -12,7 +12,6 @@ import me.totalfreedom.totalfreedommod.blocking.BlockBlocker;
|
|||||||
import me.totalfreedom.totalfreedommod.blocking.EditBlocker;
|
import me.totalfreedom.totalfreedommod.blocking.EditBlocker;
|
||||||
import me.totalfreedom.totalfreedommod.blocking.EventBlocker;
|
import me.totalfreedom.totalfreedommod.blocking.EventBlocker;
|
||||||
import me.totalfreedom.totalfreedommod.blocking.InteractBlocker;
|
import me.totalfreedom.totalfreedommod.blocking.InteractBlocker;
|
||||||
import me.totalfreedom.totalfreedommod.blocking.InventoryBlocker;
|
|
||||||
import me.totalfreedom.totalfreedommod.blocking.MobBlocker;
|
import me.totalfreedom.totalfreedommod.blocking.MobBlocker;
|
||||||
import me.totalfreedom.totalfreedommod.blocking.PVPBlocker;
|
import me.totalfreedom.totalfreedommod.blocking.PVPBlocker;
|
||||||
import me.totalfreedom.totalfreedommod.blocking.PotionBlocker;
|
import me.totalfreedom.totalfreedommod.blocking.PotionBlocker;
|
||||||
@ -88,7 +87,6 @@ public class TotalFreedomMod extends AeroPlugin<TotalFreedomMod>
|
|||||||
public MobBlocker mb;
|
public MobBlocker mb;
|
||||||
public InteractBlocker ib;
|
public InteractBlocker ib;
|
||||||
public PotionBlocker pb;
|
public PotionBlocker pb;
|
||||||
public InventoryBlocker inb;
|
|
||||||
public LoginProcess lp;
|
public LoginProcess lp;
|
||||||
public AntiNuke nu;
|
public AntiNuke nu;
|
||||||
public AntiSpam as;
|
public AntiSpam as;
|
||||||
@ -196,7 +194,6 @@ public class TotalFreedomMod extends AeroPlugin<TotalFreedomMod>
|
|||||||
mb = services.registerService(MobBlocker.class);
|
mb = services.registerService(MobBlocker.class);
|
||||||
ib = services.registerService(InteractBlocker.class);
|
ib = services.registerService(InteractBlocker.class);
|
||||||
pb = services.registerService(PotionBlocker.class);
|
pb = services.registerService(PotionBlocker.class);
|
||||||
inb = services.registerService(InventoryBlocker.class);
|
|
||||||
lp = services.registerService(LoginProcess.class);
|
lp = services.registerService(LoginProcess.class);
|
||||||
nu = services.registerService(AntiNuke.class);
|
nu = services.registerService(AntiNuke.class);
|
||||||
as = services.registerService(AntiSpam.class);
|
as = services.registerService(AntiSpam.class);
|
||||||
|
@ -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;
|
|
||||||
}
|
|
||||||
}
|
|
@ -51,7 +51,7 @@ public class Command_toggle extends FreedomCommand
|
|||||||
}
|
}
|
||||||
else if (args[0].equalsIgnoreCase("frostwalk"))
|
else if (args[0].equalsIgnoreCase("frostwalk"))
|
||||||
{
|
{
|
||||||
toggle("Frost walker enchantment is ", ConfigEntry.ALLOW_FROSTWALKER);
|
toggle("Frost walker enchantment is", ConfigEntry.ALLOW_FROSTWALKER);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else if (args[0].equalsIgnoreCase("fireplace"))
|
else if (args[0].equalsIgnoreCase("fireplace"))
|
||||||
@ -180,7 +180,7 @@ public class Command_toggle extends FreedomCommand
|
|||||||
}
|
}
|
||||||
else if (args[0].equalsIgnoreCase("tpronjoin"))
|
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;
|
return true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user