Skip to content

Commit

Permalink
Fix crashes upon wrenching machines.
Browse files Browse the repository at this point in the history
  • Loading branch information
micdoodle8 committed Feb 4, 2014
1 parent 8f4b481 commit d7fabab
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 27 deletions.
Expand Up @@ -267,20 +267,15 @@ else if (metadata >= GCCoreBlockOxygenCompressor.OXYGEN_COMPRESSOR_METADATA)
@Override
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z)
{
int id = this.idPicked(world, x, y, z);

if (id == 0)
{
return null;
}

Item item = Item.itemsList[id];
Item item = Item.itemsList[this.blockID];

if (item == null)
{
return null;
}

return new ItemStack(id, 1, this.damageDropped(world.getBlockMetadata(x, y, z)));
int metadata = this.getDamageValue(world, x, y, z);

return new ItemStack(this.blockID, 1, metadata);
}
}
Expand Up @@ -263,14 +263,7 @@ public int damageDropped(int metadata)
@Override
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z)
{
int id = this.idPicked(world, x, y, z);

if (id == 0)
{
return null;
}

Item item = Item.itemsList[id];
Item item = Item.itemsList[this.blockID];

if (item == null)
{
Expand All @@ -279,7 +272,7 @@ public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, i

int metadata = this.getDamageValue(world, x, y, z);

return new ItemStack(id, 1, metadata);
return new ItemStack(this.blockID, 1, metadata);
}

@Override
Expand Down
Expand Up @@ -403,14 +403,7 @@ else if (metadata >= GCMarsBlockMachine.CRYOGENIC_CHAMBER_METADATA)
@Override
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z)
{
int id = this.idPicked(world, x, y, z);

if (id == 0)
{
return null;
}

Item item = Item.itemsList[id];
Item item = Item.itemsList[this.blockID];

if (item == null)
{
Expand All @@ -419,7 +412,7 @@ public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, i

int metadata = this.getDamageValue(world, x, y, z);

return new ItemStack(id, 1, metadata);
return new ItemStack(this.blockID, 1, metadata);
}

@Override
Expand Down

0 comments on commit d7fabab

Please sign in to comment.