Dirty workaround to fix #312

Don't open chisel GUI if the block clicked on has a tile entity. Most TE's have GUIs anyway, so this shouldn't be noticable.

Also ignore /world and /config from workspace
This commit is contained in:
warlordjones committed 2015-05-28 18:04:36 +01:00
1 parent a7f7f5a6ae
commit 47754dd9e0
3 files changed
+10 -6

No files matched your search

@@ -22,7 +22,7 @@ import cpw.mods.fml.common.eventhandler.SubscribeEvent;
public final class ChiselController {
public static final ChiselController INSTANCE = new ChiselController();
private long lastTickClick = 0;
private ChiselController() {
@@ -55,9 +55,9 @@ public final class ChiselController {
if (group == null) {
return;
}
List<ICarvingVariation> list = group.getVariations();
main: for (ItemStack stack : OreDictionary.getOres(group.getOreName())) {
ICarvingVariation v = General.getVariation(stack);
for (ICarvingVariation check : list) {
@@ -105,7 +105,7 @@ public final class ChiselController {
} else {
lastTickClick = event.world.getTotalWorldTime();
}
if (!event.world.isRemote && chisel.canOpenGui(event.world, event.entityPlayer, held)) {
if (!event.world.isRemote && chisel.canOpenGui(event.world, event.entityPlayer, held) && event.world.getTileEntity(event.x, event.y, event.z) == null) {
event.entityPlayer.openGui(Chisel.instance, 0, event.world, 0, 0, 0);
}
break;
@@ -22,7 +22,8 @@ public class ChiselGuiHandler implements IGuiHandler {
public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
switch (ID) {
case 0:
return new ContainerChisel(player.inventory, new InventoryChiselSelection(player.getCurrentEquippedItem()));
if (player.getCurrentEquippedItem() != null)
return new ContainerChisel(player.inventory, new InventoryChiselSelection(player.getCurrentEquippedItem()));
case 1:
TileEntity tileentity = world.getTileEntity(x, y, z);
if (tileentity instanceof TileEntityAutoChisel)
@@ -40,7 +41,8 @@ public class ChiselGuiHandler implements IGuiHandler {
public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
switch (ID) {
case 0:
return new GuiChisel(player.inventory, new InventoryChiselSelection(player.getCurrentEquippedItem()));
if (player.getCurrentEquippedItem() != null)
return new GuiChisel(player.inventory, new InventoryChiselSelection(player.getCurrentEquippedItem()));
case 1:
TileEntity tileentity = world.getTileEntity(x, y, z);
if (tileentity instanceof TileEntityAutoChisel)