fix: hide muted custom name + drop playerpressureplate on blockbreak
All checks were successful
Gitea Actions Demo / Build-Gradle (push) Successful in 2m23s

This commit is contained in:
Your Name
2025-07-31 00:00:18 +02:00
parent 795bb486d1
commit 9f11fef231
2 changed files with 8 additions and 1 deletions

View File

@@ -16,6 +16,7 @@ public class EntityMuter implements Listener {
if (event.getEntity().customName() != null) { if (event.getEntity().customName() != null) {
if (event.getEntity().customName().toString().contains("muted")) { if (event.getEntity().customName().toString().contains("muted")) {
event.getEntity().setSilent(true); event.getEntity().setSilent(true);
event.getEntity().setCustomNameVisible(false);
} }
} }
} }

View File

@@ -119,7 +119,6 @@ public class PlayerPressurePlates implements Listener {
if (meta.getPersistentDataContainer().has(plateKey, PersistentDataType.BYTE)) { if (meta.getPersistentDataContainer().has(plateKey, PersistentDataType.BYTE)) {
plateLocations.add(event.getBlockPlaced().getLocation()); plateLocations.add(event.getBlockPlaced().getLocation());
event.getPlayer().sendMessage("§aPlayer-only pressure plate placed.");
savePlates(); savePlates();
} }
} }
@@ -131,6 +130,13 @@ public class PlayerPressurePlates implements Listener {
if (isPressurePlate(block.getType()) && plateLocations.contains(loc)) { if (isPressurePlate(block.getType()) && plateLocations.contains(loc)) {
plateLocations.remove(loc); plateLocations.remove(loc);
savePlates(); savePlates();
event.setDropItems(false);
ItemStack dropItem = new ItemStack(block.getType());
ItemMeta meta = dropItem.getItemMeta();
meta.displayName(Component.text("Spieler Druckplatte").decoration(TextDecoration.ITALIC, false));
meta.getPersistentDataContainer().set(plateKey, PersistentDataType.BYTE, (byte) 1);
dropItem.setItemMeta(meta);
event.getBlock().getWorld().dropItemNaturally(event.getBlock().getLocation(), dropItem);
} }
} }