Allow containers to be named playernames to have them be accessed by that player
This commit is contained in:
parent
543820ab71
commit
d26c6a8082
|
|
@ -1141,7 +1141,8 @@ class PlayerEventHandler implements Listener
|
||||||
if(block.getState() instanceof InventoryHolder) {
|
if(block.getState() instanceof InventoryHolder) {
|
||||||
if (block.getState() instanceof Nameable nameable) {
|
if (block.getState() instanceof Nameable nameable) {
|
||||||
if (nameable.getCustomName() != null) {
|
if (nameable.getCustomName() != null) {
|
||||||
if (ChatColor.stripColor(nameable.getCustomName()).equalsIgnoreCase("public")) {
|
String customName = ChatColor.stripColor(nameable.getCustomName());
|
||||||
|
if (customName.equalsIgnoreCase("public") || customName.equalsIgnoreCase(player.getName())) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user