From efdbeb31aaea760e1948ff9df3faca3f1d304284 Mon Sep 17 00:00:00 2001 From: Adrian Siekierka Date: Fri, 7 Nov 2014 23:40:35 +0100 Subject: [PATCH] fix #2175 --- common/buildcraft/BuildCraftEnergy.java | 1 - common/buildcraft/core/TileBuildCraft.java | 3 +-- common/buildcraft/energy/TileEnergyEmitter.java | 1 - common/buildcraft/energy/TileEngine.java | 1 - common/buildcraft/factory/TileMiningWell.java | 2 +- common/buildcraft/factory/TileQuarry.java | 2 +- common/buildcraft/transport/ItemFacade.java | 13 +++++++++++++ 7 files changed, 16 insertions(+), 7 deletions(-) mode change 100755 => 100644 common/buildcraft/transport/ItemFacade.java diff --git a/common/buildcraft/BuildCraftEnergy.java b/common/buildcraft/BuildCraftEnergy.java index 3125b83b..4ba48c1d 100644 --- a/common/buildcraft/BuildCraftEnergy.java +++ b/common/buildcraft/BuildCraftEnergy.java @@ -8,7 +8,6 @@ */ package buildcraft; -import java.util.HashSet; import java.util.Set; import java.util.TreeMap; diff --git a/common/buildcraft/core/TileBuildCraft.java b/common/buildcraft/core/TileBuildCraft.java index b549a77c..e729fe22 100644 --- a/common/buildcraft/core/TileBuildCraft.java +++ b/common/buildcraft/core/TileBuildCraft.java @@ -19,7 +19,6 @@ import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.network.Packet; import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; import cofh.api.energy.IEnergyHandler; import buildcraft.BuildCraftCore; @@ -168,7 +167,7 @@ public abstract class TileBuildCraft extends TileEntity implements ISynchronized @Override public int hashCode() { - return ((xCoord * 37 + yCoord) * 37 + zCoord); + return (xCoord * 37 + yCoord) * 37 + zCoord; } @Override diff --git a/common/buildcraft/energy/TileEnergyEmitter.java b/common/buildcraft/energy/TileEnergyEmitter.java index c7b738a1..c2ac3bb7 100644 --- a/common/buildcraft/energy/TileEnergyEmitter.java +++ b/common/buildcraft/energy/TileEnergyEmitter.java @@ -12,7 +12,6 @@ import java.util.Map; import java.util.TreeMap; import net.minecraft.util.AxisAlignedBB; -import net.minecraft.world.World; import buildcraft.api.core.BlockIndex; import buildcraft.api.core.SafeTimeTracker; diff --git a/common/buildcraft/energy/TileEngine.java b/common/buildcraft/energy/TileEngine.java index d1914dea..4975a5c8 100644 --- a/common/buildcraft/energy/TileEngine.java +++ b/common/buildcraft/energy/TileEngine.java @@ -20,7 +20,6 @@ import buildcraft.api.power.IPowerEmitter; import buildcraft.api.power.IPowerReceptor; import buildcraft.api.power.PowerHandler; import buildcraft.api.power.PowerHandler.PowerReceiver; -import buildcraft.api.power.PowerHandler.Type; import buildcraft.api.transport.IPipeConnection; import buildcraft.api.transport.IPipeTile; import buildcraft.api.transport.IPipeTile.PipeType; diff --git a/common/buildcraft/factory/TileMiningWell.java b/common/buildcraft/factory/TileMiningWell.java index 7414d70c..9e32c576 100644 --- a/common/buildcraft/factory/TileMiningWell.java +++ b/common/buildcraft/factory/TileMiningWell.java @@ -10,7 +10,6 @@ package buildcraft.factory; import java.util.List; -import buildcraft.core.proxy.CoreProxy; import net.minecraft.entity.item.EntityItem; import net.minecraft.item.ItemStack; import net.minecraft.world.World; @@ -25,6 +24,7 @@ import buildcraft.api.transport.IPipeConnection; import buildcraft.api.transport.IPipeTile.PipeType; import buildcraft.core.RFBattery; import buildcraft.core.TileBuildCraft; +import buildcraft.core.proxy.CoreProxy; import buildcraft.core.utils.BlockUtil; import buildcraft.core.utils.Utils; diff --git a/common/buildcraft/factory/TileQuarry.java b/common/buildcraft/factory/TileQuarry.java index 31cbfc85..db6e79c2 100644 --- a/common/buildcraft/factory/TileQuarry.java +++ b/common/buildcraft/factory/TileQuarry.java @@ -30,6 +30,7 @@ import net.minecraftforge.common.ForgeChunkManager.Ticket; import net.minecraftforge.common.ForgeChunkManager.Type; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.event.world.BlockEvent; import buildcraft.BuildCraftCore; import buildcraft.BuildCraftFactory; import buildcraft.api.core.BuildCraftAPI; @@ -51,7 +52,6 @@ import buildcraft.core.network.PacketUpdate; import buildcraft.core.proxy.CoreProxy; import buildcraft.core.utils.BlockUtil; import buildcraft.core.utils.Utils; -import net.minecraftforge.event.world.BlockEvent; public class TileQuarry extends TileAbstractBuilder implements IHasWork, ISidedInventory { diff --git a/common/buildcraft/transport/ItemFacade.java b/common/buildcraft/transport/ItemFacade.java old mode 100755 new mode 100644 index f3cf3dc0..ae32f59f --- a/common/buildcraft/transport/ItemFacade.java +++ b/common/buildcraft/transport/ItemFacade.java @@ -250,6 +250,19 @@ public class ItemFacade extends ItemBuildCraft implements IFacadeItem { ItemStack stack = new ItemStack(item, 1, i); + // Check if all of these functions work correctly. + // If an exception is filed, or null is returned, this generally means that + // this block is invalid. + // We do not use getSubBlocks() to permit for rotated combinations of a given facade. + // TODO: Rewrite to use getSubBlocks + try { + if (stack.getUnlocalizedName() == null || stack.getDisplayName() == null) { + continue; + } + } catch(Throwable t) { + continue; + } + if (!Strings.isNullOrEmpty(stack.getUnlocalizedName()) && names.add(stack.getUnlocalizedName())) { addFacade("buildcraft:facade{" + Block.blockRegistry.getNameForObject(block) + "#"