fix: hide muted custom name + drop playerpressureplate on blockbreak
All checks were successful
Gitea Actions Demo / Build-Gradle (push) Successful in 2m23s
All checks were successful
Gitea Actions Demo / Build-Gradle (push) Successful in 2m23s
This commit is contained in:
@@ -16,6 +16,7 @@ public class EntityMuter implements Listener {
|
||||
if (event.getEntity().customName() != null) {
|
||||
if (event.getEntity().customName().toString().contains("muted")) {
|
||||
event.getEntity().setSilent(true);
|
||||
event.getEntity().setCustomNameVisible(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -119,7 +119,6 @@ public class PlayerPressurePlates implements Listener {
|
||||
|
||||
if (meta.getPersistentDataContainer().has(plateKey, PersistentDataType.BYTE)) {
|
||||
plateLocations.add(event.getBlockPlaced().getLocation());
|
||||
event.getPlayer().sendMessage("§aPlayer-only pressure plate placed.");
|
||||
savePlates();
|
||||
}
|
||||
}
|
||||
@@ -131,6 +130,13 @@ public class PlayerPressurePlates implements Listener {
|
||||
if (isPressurePlate(block.getType()) && plateLocations.contains(loc)) {
|
||||
plateLocations.remove(loc);
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user