Show wire type in phased facade tooltip

This commit is contained in:
dmillerw 2014-04-27 18:31:23 -07:00
parent b6352e71d0
commit b1be97331c
2 changed files with 15 additions and 1 deletions

View file

@ -8,10 +8,11 @@
*/
package buildcraft.api.transport;
import java.util.Locale;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import java.util.Locale;
public enum PipeWire {
RED, BLUE, GREEN, YELLOW;
@ -35,6 +36,12 @@ public enum PipeWire {
return name().toLowerCase(Locale.ENGLISH) + "PipeWire";
}
public String getColor() {
String name = this.toString().toLowerCase(Locale.ENGLISH);
char first = Character.toUpperCase(name.charAt(0));
return first + name.substring(1);
}
public ItemStack getStack() {
return getStack(1);
}

View file

@ -101,6 +101,13 @@ public class ItemFacade extends ItemBuildCraft {
return "item.Facade";
}
@Override
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean debug) {
if (getType(stack) == TYPE_PHASED) {
list.add("Wire: " + PipeWire.fromOrdinal(getWireType(stack)).getColor());
}
}
@SuppressWarnings({"unchecked", "rawtypes"})
@Override
@SideOnly(Side.CLIENT)