Merge pull request 'Fix item pickup and exploding chests' (#392) from itemFixes into master
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Reviewed-on: #392 Reviewed-by: Chaoscaot <chaoscaot@zohomail.eu>
Dieser Commit ist enthalten in:
Commit
1a13446548
@ -27,6 +27,7 @@ import org.bukkit.event.EventHandler;
|
|||||||
import org.bukkit.event.Listener;
|
import org.bukkit.event.Listener;
|
||||||
import org.bukkit.event.inventory.InventoryClickEvent;
|
import org.bukkit.event.inventory.InventoryClickEvent;
|
||||||
import org.bukkit.event.inventory.InventoryDragEvent;
|
import org.bukkit.event.inventory.InventoryDragEvent;
|
||||||
|
import org.bukkit.event.player.PlayerPickupItemEvent;
|
||||||
|
|
||||||
public class DenyInventoryMovement implements Listener {
|
public class DenyInventoryMovement implements Listener {
|
||||||
|
|
||||||
@ -48,4 +49,9 @@ public class DenyInventoryMovement implements Listener {
|
|||||||
if(!PersonalKitCreator.inKitCreator(event.getWhoClicked()))
|
if(!PersonalKitCreator.inKitCreator(event.getWhoClicked()))
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void onItemPickup(PlayerPickupItemEvent event) {
|
||||||
|
event.setCancelled(true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -40,6 +40,7 @@ import org.bukkit.event.Listener;
|
|||||||
import org.bukkit.event.block.BlockBreakEvent;
|
import org.bukkit.event.block.BlockBreakEvent;
|
||||||
import org.bukkit.event.block.BlockDispenseEvent;
|
import org.bukkit.event.block.BlockDispenseEvent;
|
||||||
import org.bukkit.event.block.BlockFromToEvent;
|
import org.bukkit.event.block.BlockFromToEvent;
|
||||||
|
import org.bukkit.event.entity.EntityExplodeEvent;
|
||||||
import org.bukkit.event.entity.FoodLevelChangeEvent;
|
import org.bukkit.event.entity.FoodLevelChangeEvent;
|
||||||
import org.bukkit.event.entity.PlayerDeathEvent;
|
import org.bukkit.event.entity.PlayerDeathEvent;
|
||||||
import org.bukkit.event.entity.SpawnerSpawnEvent;
|
import org.bukkit.event.entity.SpawnerSpawnEvent;
|
||||||
@ -178,6 +179,18 @@ public class Permanent implements Listener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
||||||
|
public void onExplosion(EntityExplodeEvent e) {
|
||||||
|
e.blockList().removeIf(block -> {
|
||||||
|
if(block.getType() == Material.TNT) {
|
||||||
|
return false;
|
||||||
|
} else {
|
||||||
|
block.setType(Material.AIR);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onWorldLoad(WorldLoadEvent e) {
|
public void onWorldLoad(WorldLoadEvent e) {
|
||||||
if(!Config.ArenaLeaveable)
|
if(!Config.ArenaLeaveable)
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren