more fixes following last pull

This commit is contained in:
SpaceToad 2014-02-15 14:16:23 +01:00
parent 8a30d95286
commit 6b21bdd901
2 changed files with 17 additions and 11 deletions

View file

@ -132,17 +132,19 @@ public class ItemFacade extends ItemBuildCraft {
}
}
Item base = Item.getItemFromBlock(b);
ItemStack base = new ItemStack(b, 1);
if (base != null) {
List <ItemStack> stackList = new ArrayList<ItemStack> ();
if ( FMLCommonHandler.instance().getSide() == Side.CLIENT ) {
base.getSubItems(base, null, stackList);
}
if (base.getHasSubtypes()) {
Set<String> names = Sets.newHashSet();
for (ItemStack s : stackList) {
ItemFacade.addFacade(s);
for (int meta = 0; meta <= 15; meta++) {
ItemStack is = new ItemStack(b, 1, meta);
if (!Strings.isNullOrEmpty(is.getUnlocalizedName()) && names.add(is.getUnlocalizedName())) {
ItemFacade.addFacade(is);
}
}
} else {
ItemFacade.addFacade(base);
}
}
}

View file

@ -10,7 +10,11 @@ package buildcraft.transport.gates;
import buildcraft.core.DefaultProps;
import buildcraft.core.utils.StringUtils;
import java.util.Locale;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.util.IIcon;
import net.minecraft.util.ResourceLocation;