mirror of
https://github.com/GTNewHorizons/Chisel.git
synced 2026-11-11 15:57:31 +00:00
fix aiob when opening chisel in some slots (#51)
This commit is contained in:
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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user