mirror of
https://github.com/alexcrea/CustomAnvil.git
synced 2026-06-23 08:14:00 +02:00
avoid looping on same name
This commit is contained in:
parent
1b3447d041
commit
fb27ad2e55
1 changed files with 4 additions and 1 deletions
|
|
@ -109,12 +109,15 @@ class AnvilRenameDialogImpl(
|
|||
|
||||
private fun setName(player: HumanEntity, view: CraftAnvilView, name: String?) {
|
||||
val menu = (containerField.get(view) as AnvilMenu)
|
||||
val isSameName = menu.itemName == name
|
||||
menu.itemName = name
|
||||
|
||||
if(name == null)
|
||||
lastNames.remove(player.uniqueId)
|
||||
else
|
||||
lastNames[player.uniqueId] = name
|
||||
|
||||
if(!isSameName)
|
||||
CraftEventFactory.callPrepareResultEvent(menu, 2);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue