forked from GeyserMC/Geyser
BedrockMobEquipmentTranslator: Don't change item slot if already on that slot (#1353)
* BedrockMobEquipmentTranslator: Don't change item slot if already on that slot * Update comment
This commit is contained in:
parent
45c5ef02cd
commit
59f72d0e65
1 changed files with 2 additions and 1 deletions
|
@ -40,7 +40,8 @@ public class BedrockMobEquipmentTranslator extends PacketTranslator<MobEquipment
|
||||||
@Override
|
@Override
|
||||||
public void translate(MobEquipmentPacket packet, GeyserSession session) {
|
public void translate(MobEquipmentPacket packet, GeyserSession session) {
|
||||||
if (!session.isSpawned() || packet.getHotbarSlot() > 8 ||
|
if (!session.isSpawned() || packet.getHotbarSlot() > 8 ||
|
||||||
packet.getContainerId() != ContainerId.INVENTORY) {
|
packet.getContainerId() != ContainerId.INVENTORY || session.getInventory().getHeldItemSlot() == packet.getHotbarSlot()) {
|
||||||
|
// For the last condition - Don't update the slot if the slot is the same - not Java Edition behavior and messes with plugins such as Grief Prevention
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue