ProtectionExplosion.java 703 B

123456789101112131415161718192021222324
  1. package me.km.plots;
  2. import me.km.api.Module;
  3. import net.minecraft.util.math.BlockPos;
  4. import net.minecraftforge.event.world.ExplosionEvent;
  5. import net.minecraftforge.fml.common.eventhandler.EventPriority;
  6. import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
  7. public class ProtectionExplosion extends Protection
  8. {
  9. public ProtectionExplosion(Module m)
  10. {
  11. super(m);
  12. }
  13. @SubscribeEvent(priority = EventPriority.HIGHEST)
  14. public void BlockExplosionProtection(ExplosionEvent.Start e)
  15. {
  16. if(!this.getProtectionBank().hasTag(e.getWorld(), new BlockPos(e.getExplosion().getPosition()), "TNT"))
  17. {
  18. e.setCanceled(true);
  19. }
  20. }
  21. }