Skip to content

Commit

Permalink
Merge branch '1.20.2-server-renderer' into 1.20.2
Browse files Browse the repository at this point in the history
  • Loading branch information
MATRIX-feather committed Jan 15, 2024
2 parents e4ee36b + 7a2af19 commit 732c8f0
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,9 @@ public SingleWatcher(Player bindingPlayer, EntityType entityType)
this.bindingUUID = bindingPlayer.getUniqueId();
this.bindingPlayer = bindingPlayer;

syncing = true;
this.entityType = entityType;
initRegistry();
initValues();

sync();
syncing = false;
}

//region Custom Registry
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,11 @@ protected void initRegistry()
register(ValueIndex.BASE_LIVING);
}

private Map<Player, EquipmentSlot> handMap;

private void ensureHandMapPresent()
{
if (handMap == null)
handMap = new Object2ObjectArrayMap<>();
}
private final Map<Player, EquipmentSlot> handMap = new Object2ObjectArrayMap<>();

@EventHandler
public void onPlayerStartUsingItem(PlayerInteractEvent e)
{
ensureHandMapPresent();
handMap.put(e.getPlayer(), e.getHand());
}

Expand All @@ -67,8 +60,6 @@ protected void doSync()
{
flagBit |= 0x01;

ensureHandMapPresent();

var handInUse = handMap.remove(player);

if (handInUse == null)
Expand Down

0 comments on commit 732c8f0

Please sign in to comment.