Fix left clicking a metal block incorrectly changing the type

This commit is contained in:
tterrag1098 committed 2015-02-16 12:40:08 -05:00
1 parent 55807a5f0b
commit 25a54b71e1
2 files changed
+9 -5

No files matched your search

@@ -1,18 +1,17 @@
package com.cricketcraft.chisel.inventory;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.ContainerChest;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
public class ContainerPresent extends ContainerChest {
public class ContainerPresent extends Container {
private IInventory lower;
private int rows;
public ContainerPresent(IInventory player, IInventory chest) {
super(player, chest);
lower = chest;
rows = chest.getSizeInventory() / 9;
chest.openInventory();
@@ -52,7 +51,7 @@ public class ContainerPresent extends ContainerChest {
if (p_82846_2_ < rows * 9)
{
if (!this.mergeItemStack(itemstack1, rows * 9, rows * 9 + 36, true))
if (!this.mergeItemStack(itemstack1, rows * 9, inventorySlots.size(), true))
{
return null;
}
@@ -74,4 +73,9 @@ public class ContainerPresent extends ContainerChest {
return itemstack;
}
@Override
public boolean canInteractWith(EntityPlayer p_75145_1_) {
return true;
}
}
@@ -102,7 +102,7 @@ public enum ChiselMode implements IChiselMode {
}
if (held != null && held.getItem() instanceof IChiselItem) {
if (origBlock == block) {
if (origBlock == v.getBlock()) {
world.setBlockMetadataWithNotify(x, y, z, v.getBlockMeta(), 3);
} else {
world.setBlock(x, y, z, v.getBlock(), v.getBlockMeta(), 3);