Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Osmotic Enchanter doesn't lose your settings when you add/remove a wand before starting enchantment #1054

Open
wants to merge 6 commits into
base: 1.7-final
Choose a base branch
from
Original file line number Diff line number Diff line change
Expand Up @@ -232,8 +232,6 @@ public boolean consumeAllVisCrafting(ItemStack is, EntityPlayer player, AspectLi
public void markDirty() {
super.markDirty();
if (!worldObj.isRemote && !working) {
enchantments.clear();
levels.clear();
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
}
}
Expand Down Expand Up @@ -390,13 +388,13 @@ public ItemStack decrStackSize(int i, int j) {

if (inventorySlots[i].stackSize <= j) {
stackAt = inventorySlots[i];
inventorySlots[i] = null;
setInventorySlotContents(i, null);
return stackAt;
} else {
stackAt = inventorySlots[i].splitStack(j);

if (inventorySlots[i].stackSize == 0)
inventorySlots[i] = null;
setInventorySlotContents(i, null);

return stackAt;
}
Expand All @@ -413,6 +411,8 @@ public ItemStack getStackInSlotOnClosing(int i) {
@Override
public void setInventorySlotContents(int i, ItemStack itemstack) {
inventorySlots[i] = itemstack;
if(i==0)
clearEnchants();
}

@Override
Expand Down