mirror of
https://github.com/GeyserMC/Geyser.git
synced 2024-08-14 23:57:35 +00:00
Use putIfAbsent instead of double checks
This commit is contained in:
parent
018232b281
commit
c5e1eab423
1 changed files with 1 additions and 3 deletions
|
|
@ -181,9 +181,7 @@ public final class ItemTranslator {
|
|||
// Add enchantment override. We can't remove it - enchantments would stop showing - but we can add it.
|
||||
if (enchantmentGlint) {
|
||||
NbtMapBuilder nbtMapBuilder = nbtBuilder.getOrCreateNbt();
|
||||
if (!nbtMapBuilder.containsKey("ench")) {
|
||||
nbtMapBuilder.put("ench", NbtList.EMPTY);
|
||||
}
|
||||
nbtMapBuilder.putIfAbsent("ench", NbtList.EMPTY);
|
||||
}
|
||||
|
||||
ItemData.Builder builder = javaItem.translateToBedrock(count, components, bedrockItem, session.getItemMappings());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue