mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2024-11-27 01:05:38 +00:00
this was a failure i forgot to remove
This commit is contained in:
parent
72db71b3cf
commit
2408054a49
@ -3,15 +3,8 @@ package me.totalfreedom.totalfreedommod.blocking;
|
||||
import me.totalfreedom.totalfreedommod.FreedomService;
|
||||
import me.totalfreedom.totalfreedommod.TotalFreedomMod;
|
||||
import me.totalfreedom.totalfreedommod.config.ConfigEntry;
|
||||
import me.totalfreedom.totalfreedommod.util.FLog;
|
||||
import me.totalfreedom.totalfreedommod.util.MaterialGroup;
|
||||
import org.bukkit.attribute.Attribute;
|
||||
import org.bukkit.attribute.AttributeModifier;
|
||||
import org.bukkit.block.Dispenser;
|
||||
import org.bukkit.block.ShulkerBox;
|
||||
import org.bukkit.event.block.BlockDispenseEvent;
|
||||
import org.bukkit.event.block.BlockFormEvent;
|
||||
import org.bukkit.event.block.EntityBlockFormEvent;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.Tameable;
|
||||
import org.bukkit.event.EventHandler;
|
||||
@ -218,49 +211,4 @@ public class EventBlocker extends FreedomService
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGH)
|
||||
public void onBlockDispense(BlockDispenseEvent event)
|
||||
{
|
||||
if (event.getBlock() instanceof ShulkerBox)
|
||||
{
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGH)
|
||||
public void onEntityBlockForm(EntityBlockFormEvent event)
|
||||
{
|
||||
FLog.info("block form by entity fired");
|
||||
if (event.getBlock() instanceof Dispenser)
|
||||
{
|
||||
Dispenser dispenser = (Dispenser)event.getBlock();
|
||||
ItemStack[] items = dispenser.getInventory().getContents();
|
||||
for (ItemStack item : items)
|
||||
{
|
||||
if (item != null && MaterialGroup.SHULKER_BOXES.contains(item.getType()))
|
||||
{
|
||||
dispenser.getInventory().clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGH)
|
||||
public void onBlockForm(BlockFormEvent event)
|
||||
{
|
||||
FLog.info("block form fired");
|
||||
if (event.getBlock() instanceof Dispenser)
|
||||
{
|
||||
Dispenser dispenser = (Dispenser)event.getBlock();
|
||||
ItemStack[] items = dispenser.getInventory().getContents();
|
||||
for (ItemStack item : items)
|
||||
{
|
||||
if (item != null && MaterialGroup.SHULKER_BOXES.contains(item.getType()))
|
||||
{
|
||||
dispenser.getInventory().clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user