A few fixes, added recipes for balloons

This commit is contained in:
Aidan Brady 2013-12-22 00:42:46 -05:00
parent 96fdb4d168
commit 4812b432fd
4 changed files with 71 additions and 30 deletions

View file

@ -9,36 +9,41 @@ import net.minecraft.util.StatCollector;
*/
public enum EnumColor
{
BLACK("\u00a70", "black", new int[] {0, 0, 0}),
DARK_BLUE("\u00a71", "darkBlue", new int[] {0, 0, 170}),
DARK_GREEN("\u00a72", "darkGreen", new int[] {0, 170, 0}),
DARK_AQUA("\u00a73", "darkAqua", new int[] {0, 170, 170}),
DARK_RED("\u00a74", "darkRed", new int[] {170, 0, 0}),
PURPLE("\u00a75", "purple", new int[] {170, 0, 170}),
ORANGE("\u00a76", "orange", new int[] {255, 170, 0}),
GREY("\u00a77", "grey", new int[] {170, 170, 170}),
DARK_GREY("\u00a78", "darkGrey", new int[] {85, 85, 85}),
INDIGO("\u00a79", "indigo", new int[] {85, 85, 255}),
BRIGHT_GREEN("\u00a7a", "brightGreen", new int[] {85, 255, 85}),
AQUA("\u00a7b", "aqua", new int[] {85, 255, 255}),
RED("\u00a7c", "red", new int[] {255, 85, 85}),
PINK("\u00a7d", "pink", new int[] {255, 85, 255}),
YELLOW("\u00a7e", "yellow", new int[] {255, 255, 85}),
WHITE("\u00a7f", "white", new int[] {255, 255, 255});
BLACK("\u00a70", "black", new int[] {0, 0, 0}, 0),
DARK_BLUE("\u00a71", "darkBlue", new int[] {0, 0, 170}, 4),
DARK_GREEN("\u00a72", "darkGreen", new int[] {0, 170, 0}, 2),
DARK_AQUA("\u00a73", "darkAqua", new int[] {0, 170, 170}, 6),
DARK_RED("\u00a74", "darkRed", new int[] {170, 0, 0}, 1),
PURPLE("\u00a75", "purple", new int[] {170, 0, 170}, 5),
ORANGE("\u00a76", "orange", new int[] {255, 170, 0}, 14),
GREY("\u00a77", "grey", new int[] {170, 170, 170}, 7),
DARK_GREY("\u00a78", "darkGrey", new int[] {85, 85, 85}, 8),
INDIGO("\u00a79", "indigo", new int[] {85, 85, 255}, 12),
BRIGHT_GREEN("\u00a7a", "brightGreen", new int[] {85, 255, 85}, 10),
AQUA("\u00a7b", "aqua", new int[] {85, 255, 255}, -1),
RED("\u00a7c", "red", new int[] {255, 85, 85}, 13),
PINK("\u00a7d", "pink", new int[] {255, 85, 255}, 9),
YELLOW("\u00a7e", "yellow", new int[] {255, 255, 85}, 11),
WHITE("\u00a7f", "white", new int[] {255, 255, 255}, 15);
public static EnumColor[] DYES = new EnumColor[] {BLACK, DARK_RED, DARK_GREEN, null, DARK_BLUE, PURPLE, DARK_AQUA, GREY, DARK_GREY, PINK, BRIGHT_GREEN, YELLOW, INDIGO, RED, ORANGE, WHITE};
/** The color code that will be displayed */
public final String code;
public final int[] rgbCode;
public final int mcMeta;
/** A friendly name of the color. */
public String unlocalizedName;
private EnumColor(String s, String n, int[] rgb)
private EnumColor(String s, String n, int[] rgb, int meta)
{
code = s;
unlocalizedName = n;
rgbCode = rgb;
mcMeta = meta;
}
public String getLocalizedName()
@ -56,6 +61,11 @@ public enum EnumColor
return (float)rgbCode[index]/255F;
}
public int getMetaValue()
{
return mcMeta;
}
@Override
public String toString()
{

View file

@ -94,6 +94,12 @@ public class Pos3D
return new Pos3D(xPos, yPos, zPos);
}
@Override
public String toString()
{
return "[Pos3D: " + xPos + ", " + yPos + ", " + zPos + "]";
}
@Override
public boolean equals(Object obj)
{

View file

@ -15,6 +15,7 @@ import java.util.logging.Logger;
import mekanism.api.ChemicalInput;
import mekanism.api.Coord4D;
import mekanism.api.EnumColor;
import mekanism.api.gas.Gas;
import mekanism.api.gas.GasNetwork.GasTransferEvent;
import mekanism.api.gas.GasRegistry;
@ -111,6 +112,7 @@ import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.ForgeSubscribe;
import net.minecraftforge.event.world.ChunkEvent;
import net.minecraftforge.oredict.OreDictionary;
import net.minecraftforge.oredict.ShapelessOreRecipe;
import rebelkeithy.mods.metallurgy.api.IOreInfo;
import rebelkeithy.mods.metallurgy.api.MetallurgyAPI;
import universalelectricity.compatibility.Compatibility;
@ -524,6 +526,30 @@ public class Mekanism
"SGS", Character.valueOf('S'), "ingotSteel", Character.valueOf('G'), Block.glass
}));
for(int i = 0; i < EnumColor.DYES.length; i++)
{
EnumColor color = EnumColor.DYES[i];
if(color != null)
{
CraftingManager.getInstance().getRecipeList().add(new ShapelessOreRecipe(new ItemStack(Balloon, 2, i), new Object[] {
Item.leather, Item.silk, new ItemStack(Item.dyePowder, 1, i)
}));
for(int j = 0; j < EnumColor.DYES.length; j++)
{
EnumColor color1 = EnumColor.DYES[j];
if(color1 != null)
{
CraftingManager.getInstance().getRecipeList().add(new ShapelessOreRecipe(new ItemStack(Balloon, 1, i), new Object[] {
new ItemStack(Balloon, 1, j), new ItemStack(Item.dyePowder, 1, i)
}));
}
}
}
}
CraftingManager.getInstance().addShapelessRecipe(new ItemStack(PartTransmitter, 1, 0), new ItemStack(Transmitter, 1, 1));
CraftingManager.getInstance().addShapelessRecipe(new ItemStack(PartTransmitter, 1, 1), new ItemStack(Transmitter, 1, 2));
CraftingManager.getInstance().addShapelessRecipe(new ItemStack(PartTransmitter, 1, 2), new ItemStack(Transmitter, 1, 0));

View file

@ -27,19 +27,24 @@ public class ItemBalloon extends ItemMekanism
public EnumColor getColor(ItemStack stack)
{
return EnumColor.values()[stack.getItemDamage()];
return EnumColor.DYES[stack.getItemDamage()];
}
@Override
public void getSubItems(int i, CreativeTabs tabs, List list)
public void getSubItems(int id, CreativeTabs tabs, List list)
{
for(EnumColor color : EnumColor.values())
for(int i = 0; i < EnumColor.DYES.length; i++)
{
EnumColor color = EnumColor.DYES[i];
if(color != null)
{
ItemStack stack = new ItemStack(this);
stack.setItemDamage(color.ordinal());
stack.setItemDamage(i);
list.add(stack);
}
}
}
@Override
public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer entityplayer)
@ -70,7 +75,7 @@ public class ItemBalloon extends ItemMekanism
color = EnumColor.DARK_GREY + getColor(stack).getLocalizedName();
}
return getColor(stack).getName() + " " + MekanismUtils.localize("tooltip.balloon");
return color + " " + MekanismUtils.localize("tooltip.balloon");
}
@Override
@ -104,12 +109,6 @@ public class ItemBalloon extends ItemMekanism
return false;
}
/*@Override
public boolean itemInteractionForEntity(ItemStack stack, EntityPlayer player, EntityLivingBase entity)
{
return false;
}*/
private boolean canReplace(World world, int x, int y, int z)
{
return world.isAirBlock(x, y, z) || Block.blocksList[world.getBlockId(x, y, z)].isBlockReplaceable(world, x, y, z);