Skip to content

Commit

Permalink
some more fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
progwml6 committed Jan 13, 2014
1 parent 86cf32c commit dc968ae
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 27 deletions.
4 changes: 2 additions & 2 deletions src/main/java/tconstruct/inventory/ContainerLandmine.java
Expand Up @@ -108,7 +108,7 @@ public ItemStack slotClick (int par1, int par2, int par3, EntityPlayer par4Entit
{
ItemStack itemstack = null;
InventoryPlayer inventoryplayer = par4EntityPlayer.inventory;
int l;
Item l;
ItemStack itemstack1;

if (par3 == 5)
Expand Down Expand Up @@ -247,7 +247,7 @@ else if (par3 == 1)

if (itemstack1 != null)
{
l = itemstack1.itemID;
l = itemstack1.getItem();
itemstack = itemstack1.copy();

if (slot2 != null && slot2.getStack() != null && slot2.getStack().itemID == l)
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/tconstruct/items/blocks/BarricadeItem.java
Expand Up @@ -32,7 +32,7 @@ public void addInformation (ItemStack stack, EntityPlayer player, List list, boo

public boolean onItemUse (ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ)
{
Block b = world.getBlock(x, y, z);
Block b = world.func_147439_a(x, y, z);

if (b == Blocks.snow && (world.getBlockMetadata(x, y, z) & 7) < 1)
{
Expand Down
Expand Up @@ -24,7 +24,7 @@ public SlimeTallGrassItem(Block b)
public IIcon getIconFromDamage (int meta)
{
int arr = MathHelper.clamp_int(meta, 0, this.blockType.length);
return TRepo.slimeTallGrass.getIcon(0, arr);
return TRepo.slimeTallGrass.func_149691_a(0, arr);
}

}
7 changes: 4 additions & 3 deletions src/main/java/tconstruct/items/tools/Chisel.java
Expand Up @@ -5,6 +5,7 @@
import tconstruct.library.crafting.Detailing.DetailInput;
import tconstruct.library.tools.AbilityHelper;
import tconstruct.library.tools.ToolCore;
import net.minecraft.block.Block;
import net.minecraft.client.entity.EntityPlayerSP;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
Expand Down Expand Up @@ -94,13 +95,13 @@ public ItemStack onEaten (ItemStack itemstack, World world, EntityPlayer entityp
int x = movingobjectposition.blockX;
int y = movingobjectposition.blockY;
int z = movingobjectposition.blockZ;
int blockID = world.getBlockId(x, y, z);
Block block = world.func_147439_a(x, y, z);
int meta = world.getBlockMetadata(x, y, z);

DetailInput details = TConstruct.chiselDetailing.getDetailing(blockID, meta);
DetailInput details = TConstruct.chiselDetailing.getDetailing(block, meta);
if (details != null && details.outputID < 4096)
{
world.setBlock(x, y, z, details.outputID, details.outputMeta, 3);
world.setBlock(x, y, z, details.output, details.outputMeta, 3);
if (!(entityplayer.capabilities.isCreativeMode))
{
int reinforced = 0;
Expand Down
36 changes: 18 additions & 18 deletions src/main/java/tconstruct/library/crafting/Detailing.java
Expand Up @@ -17,28 +17,28 @@ public class Detailing

public void addDetailing (Object input, int inputMeta, Object output, int outputMeta, ToolCore tool)
{
int iID, iMeta = inputMeta, oID, oMeta = outputMeta;
ItemStack iID, oID;
int iMeta = inputMeta, oMeta = outputMeta;

if (input instanceof Block)
iID = ((Block) input).blockID;
iID = new ItemStack(((Block) input));

else if (input instanceof Item)
iID = ((Item) input).itemID;

else if (input instanceof Integer)
iID = (Integer) input;
iID = new ItemStack(((Item) input));
else if (input instanceof ItemStack)
iID = ((ItemStack) input);

else
throw new RuntimeException("Invalid detail input!");

if (output instanceof Block)
oID = ((Block) output).blockID;
oID = new ItemStack((Block) output);

else if (output instanceof Item)
oID = ((Item) output).itemID;
oID = new ItemStack((Item) output);

else if (output instanceof Integer)
oID = (Integer) output;
else if (output instanceof ItemStack)
oID = (ItemStack) output;

else
throw new RuntimeException("Invalid detail output!");
Expand All @@ -60,7 +60,7 @@ public void addDetailing (DetailInput details, ToolCore tool)
toolTag.setInteger("TotalDurability", 100);
compound.setTag("InfiTool", toolTag);
toolstack.setTagCompound(compound);
addShapelessToolRecipe(new ItemStack(details.output, 1, details.outputMeta), toolstack, new ItemStack(details.input, 1, details.inputMeta));
addShapelessToolRecipe(new ItemStack(details.output.getItem(), 1, details.outputMeta), toolstack, new ItemStack(details.input.getItem(), 1, details.inputMeta));
}

public void addShapelessToolRecipe (ItemStack par1ItemStack, Object... par2ArrayOfObj)
Expand Down Expand Up @@ -95,12 +95,12 @@ else if (object1 instanceof Item)
GameRegistry.addRecipe(new ShapelessToolRecipe(par1ItemStack, arraylist));
}

public DetailInput getDetailing (int inputID, int inputMeta)
public DetailInput getDetailing (Block block, int inputMeta)
{
for (int i = 0; i < detailing.size(); i++)
{
DetailInput detail = (DetailInput) detailing.get(i);
if (inputID == detail.inputID && inputMeta == detail.inputMeta)
if (new ItemStack(block) == detail.input && inputMeta == detail.inputMeta)
{
return detail;
}
Expand All @@ -110,16 +110,16 @@ public DetailInput getDetailing (int inputID, int inputMeta)

public class DetailInput
{
public int inputID;
public ItemStack input;
public int inputMeta;
public int outputID;
public ItemStack output;
public int outputMeta;

public DetailInput(int inputID, int inputMeta, int outputID, int outputMeta)
public DetailInput(ItemStack input, int inputMeta, ItemStack output, int outputMeta)
{
this.inputID = inputID;
this.input = input;
this.inputMeta = inputMeta;
this.outputID = outputID;
this.output = output;
this.outputMeta = outputMeta;
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/tconstruct/util/EnvironmentGui.java
Expand Up @@ -59,7 +59,7 @@ protected void actionPerformed (GuiButton button)
{
count++;
if (count >= mods.size())
this.field_146297_k.displayGuiScreen(this.parentGuiScreen);
this.field_146297_k.func_147108_a(this.parentGuiScreen);
}
if (button.field_146127_k == 1)
{
Expand All @@ -74,7 +74,7 @@ protected void actionPerformed (GuiButton button)
public void drawScreen (int par1, int par2, float par3)
{
builder.setLength(0);
this.drawDefaultBackground();
this.func_146276_q_();
String mod = mods.get(count);
this.drawCenteredString(this.field_146289_q, I18n.getStringParams("Tinkers' Construct is not compatible with "+mod), this.field_146294_l / 2, 20, 0xFFFFFF);
this.drawCenteredString(this.field_146289_q, I18n.getStringParams("The following reasons are given:"), this.field_146294_l / 2, 32, 0xFFFFFF);
Expand Down

0 comments on commit dc968ae

Please sign in to comment.