SteamWar/FightSystem
Archiviert
13
1

Reenable Items #373

Zusammengeführt
Lixfel hat 8 Commits von items nach master 2023-05-09 16:43:14 +02:00 zusammengeführt
3 geänderte Dateien mit 23 neuen und 5 gelöschten Zeilen
Nur Änderungen aus Commit 1890471609 werden angezeigt - Alle Commits anzeigen

Datei anzeigen

@ -27,6 +27,7 @@ import org.bukkit.event.EventPriority;
import org.bukkit.event.HandlerList; import org.bukkit.event.HandlerList;
import org.bukkit.event.Listener; import org.bukkit.event.Listener;
import org.bukkit.event.block.*; import org.bukkit.event.block.*;
import org.bukkit.event.entity.ItemSpawnEvent;
import org.bukkit.event.inventory.InventoryMoveItemEvent; import org.bukkit.event.inventory.InventoryMoveItemEvent;
import org.bukkit.event.player.PlayerInteractEvent; import org.bukkit.event.player.PlayerInteractEvent;
@ -83,6 +84,10 @@ public class FreezeWorld implements Listener {
public void onBlockExplosion(BlockExplodeEvent e){ public void onBlockExplosion(BlockExplodeEvent e){
e.setCancelled(true); e.setCancelled(true);
} }
@EventHandler
public void onBlockExplosion(ItemSpawnEvent e){
e.setCancelled(true);
}
@EventHandler(priority = EventPriority.LOW) @EventHandler(priority = EventPriority.LOW)
public void handlePlayerInteract(PlayerInteractEvent event) { public void handlePlayerInteract(PlayerInteractEvent event) {

Datei anzeigen

@ -35,6 +35,7 @@ import org.bukkit.event.block.BlockPlaceEvent;
import org.bukkit.event.entity.EntityExplodeEvent; import org.bukkit.event.entity.EntityExplodeEvent;
import org.bukkit.event.entity.ProjectileLaunchEvent; import org.bukkit.event.entity.ProjectileLaunchEvent;
import org.bukkit.event.hanging.HangingBreakEvent; import org.bukkit.event.hanging.HangingBreakEvent;
import org.bukkit.event.player.PlayerDropItemEvent;
import org.bukkit.event.player.PlayerKickEvent; import org.bukkit.event.player.PlayerKickEvent;
public class DenyWorldInteraction implements Listener { public class DenyWorldInteraction implements Listener {
@ -53,6 +54,14 @@ public class DenyWorldInteraction implements Listener {
} }
} }
@EventHandler
public void handleItemDrop(PlayerDropItemEvent event) {
Player player = event.getPlayer();
if(Fight.fighting(player)) {
event.setCancelled(true);
}
}
@EventHandler @EventHandler
public void handleHangingBreak(HangingBreakEvent event) { public void handleHangingBreak(HangingBreakEvent event) {
if(Config.ArenaRegion.inRegion(event.getEntity().getLocation())) { if(Config.ArenaRegion.inRegion(event.getEntity().getLocation())) {

Datei anzeigen

@ -137,7 +137,7 @@ public class Permanent implements Listener {
@EventHandler @EventHandler
public void onDropPickup(EntityPickupItemEvent e) { public void onDropPickup(EntityPickupItemEvent e) {
if(!(e.getEntity() instanceof Player || Config.ArenaRegion.inRegion(e.getItem().getLocation()))) if(!(e.getEntity() instanceof Player) || !(Config.ArenaRegion.inRegion(e.getItem().getLocation())))
return; return;
Player player = (Player) e.getEntity(); Player player = (Player) e.getEntity();
@ -159,10 +159,14 @@ public class Permanent implements Listener {
@EventHandler(priority = EventPriority.MONITOR) @EventHandler(priority = EventPriority.MONITOR)
public void onExplosion(EntityExplodeEvent e) { public void onExplosion(EntityExplodeEvent e) {
for(Block block : e.blockList()) { e.blockList().removeIf(block -> {
if(block.getType() == Material.TNT) {
return false;
} else {
block.setType(Material.AIR); block.setType(Material.AIR);
return true;
} }
e.blockList().clear(); });
} }
@EventHandler @EventHandler