fix aiob when opening chisel in some slots (#51)

This commit is contained in:
Lyft authored and GitHub committed 2024-08-01 07:41:25 +07:00
1 parent 568e405e25
commit 0cabe335dd
3 files changed
+4 -4

No files matched your search

@@ -152,13 +152,13 @@ public class ContainerChisel extends Container {
}
public void onChiselSlotChanged() {
ItemStack stack = playerInventory.mainInventory[chiselSlot];
ItemStack stack = playerInventory.getStackInSlot(chiselSlot);
if (stack == null || !stack.isItemEqual(chisel)) finished = true;
if (finished) return;
General.setChiselTarget(chisel, inventory.getStackInSpecialSlot());
playerInventory.mainInventory[chiselSlot] = chisel;
playerInventory.setInventorySlotContents(chiselSlot, chisel);
}
}
@@ -66,7 +66,7 @@ public class SlotChiselSelection extends Slot {
.onChisel(player.worldObj, container.chisel, General.getVariation(crafted))) {
container.chisel.damageItem(1, player);
if (container.chisel.stackSize <= 0) {
player.inventory.mainInventory[player.inventory.currentItem] = null;
player.setCurrentItemOrArmor(0, null);
}
}
@@ -121,7 +121,7 @@ public enum ChiselMode implements IChiselMode {
player.getCurrentEquippedItem()
.damageItem(1, player);
if (player.getCurrentEquippedItem().stackSize <= 0) {
player.inventory.mainInventory[player.inventory.currentItem] = null;
player.setCurrentItemOrArmor(0, null);
breakChisel = true;
}
}