Skip to content

Commit 96f60ae

Browse files
committed
Ignore armour slots in RestrictedArmourItem#inventoryTick
1 parent 6ea3853 commit 96f60ae

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/java/choonster/testmod3/world/item/RestrictedArmourItem.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public RestrictedArmourItem(final Item.Properties properties) {
4545
*/
4646
@Override
4747
public void inventoryTick(final ItemStack stack, final Level level, final Entity entity, @Nullable final EquipmentSlot slot, final int slotIndex) {
48-
if (!level.isClientSide) { // If this is the server,
48+
if (!level.isClientSide && (slot == null || !slot.isArmor())) { // If this is the server, and it's not an armour slot,
4949
// Try to remove the item from the entity's inventories
5050
InventoryUtils.forEachEntityInventory(
5151
entity,

0 commit comments

Comments
 (0)