Added proper names for facades

This commit is contained in:
Krapht 2012-08-06 23:12:02 +02:00
parent b0a2d574f1
commit 59da220fb1
4 changed files with 27 additions and 12 deletions

View file

@ -137,4 +137,10 @@ public class CoreProxy {
return CoreProxy.buildCraftPlayer;
}
public static String getItemDisplayName(ItemStack stack){
if (Item.itemsList[stack.itemID] == null) return "";
return Item.itemsList[stack.itemID].getItemDisplayName(stack);
}
}

View file

@ -67,6 +67,7 @@ item.PipeItemsVoid=Void Transport Pipe
item.PipeLiquidsVoid=Void Waterproof Pipe
item.PipeItemsSandstone=Sandstone Transport Pipe
item.PipeLiquidsSandstone=Sandstone Waterproof Pipe
item.Facade=Facade
tile.miningWellBlock=Mining Well
tile.plainPipeBlock=Mining Pipe
tile.autoWorkbenchBlock=Autocrafting Table

View file

@ -133,4 +133,8 @@ public class CoreProxy {
return CoreProxy.buildCraftPlayer;
}
public static String getItemDisplayName(ItemStack newStack) {
return "";
}
}

View file

@ -9,6 +9,7 @@ import buildcraft.BuildCraftCore;
import buildcraft.BuildCraftTransport;
import buildcraft.api.core.Orientations;
import buildcraft.api.recipes.AssemblyRecipe;
import buildcraft.core.CoreProxy;
import buildcraft.core.ItemBuildCraft;
import net.minecraft.src.Block;
@ -29,21 +30,24 @@ public class ItemFacade extends ItemBuildCraft {
setHasSubtypes(true);
setMaxDamage(0);
}
@Override
public String getItemDisplayName(ItemStack itemstack) {
String name = super.getItemDisplayName(itemstack);
int decodedBlockId = ItemFacade.getBlockId(itemstack.getItemDamage());
int decodedMeta = ItemFacade.getMetaData(itemstack.getItemDamage());
ItemStack newStack = new ItemStack(decodedBlockId, 1, decodedMeta);
if (Item.itemsList[decodedBlockId] != null){
name += ": " + CoreProxy.getItemDisplayName(newStack);
} else {
name += " < BROKEN >";
}
return name;
}
@Override
public String getItemNameIS(ItemStack itemstack) {
//FIXME PROPER NAMES
int decodedBlockId = ItemFacade.getBlockId(itemstack.getItemDamage());
int decodedMeta = ItemFacade.getMetaData(itemstack.getItemDamage());
if (Block.blocksList[decodedBlockId] == null) return "<BROKEN>";
return "Block: " + decodedBlockId + "- Meta: " + decodedMeta;
//return (new StringBuilder()).append(super.getItemName()).append(".").append(itemstack.getItemDamage()).toString();
return "item.Facade";
}
@SuppressWarnings({ "rawtypes", "unchecked" })