Fixed another missed-out activate null check
This commit is contained in:
parent
1dd2151b9b
commit
7891ba7640
2 changed files with 21 additions and 19 deletions
|
@ -285,33 +285,35 @@ public class PartFlatWire extends PartAdvancedWire implements TFacePart, JNormal
|
||||||
{
|
{
|
||||||
System.out.println(this.getNetwork());
|
System.out.println(this.getNetwork());
|
||||||
}
|
}
|
||||||
TileMultipart tile = tile();
|
|
||||||
World w = world();
|
|
||||||
|
|
||||||
if (item.getItem().itemID == Block.lever.blockID)
|
if (item != null)
|
||||||
{
|
{
|
||||||
if (!w.isRemote)
|
if (item.getItem().itemID == Block.lever.blockID)
|
||||||
{
|
{
|
||||||
PartFlatSwitchWire wire = (PartFlatSwitchWire) MultiPartRegistry.createPart("resonant_induction_flat_switch_wire", false);
|
TileMultipart tile = tile();
|
||||||
wire.copyFrom(this);
|
World w = world();
|
||||||
|
|
||||||
if (tile.canReplacePart(this, wire))
|
if (!w.isRemote)
|
||||||
{
|
{
|
||||||
tile.remPart(this);
|
PartFlatSwitchWire wire = (PartFlatSwitchWire) MultiPartRegistry.createPart("resonant_induction_flat_switch_wire", false);
|
||||||
TileMultipart.addPart(w, new BlockCoord(tile), wire);
|
wire.copyFrom(this);
|
||||||
|
|
||||||
if (!player.capabilities.isCreativeMode)
|
if (tile.canReplacePart(this, wire))
|
||||||
{
|
{
|
||||||
player.inventory.decrStackSize(player.inventory.currentItem, 1);
|
tile.remPart(this);
|
||||||
|
TileMultipart.addPart(w, new BlockCoord(tile), wire);
|
||||||
|
|
||||||
|
if (!player.capabilities.isCreativeMode)
|
||||||
|
{
|
||||||
|
player.inventory.decrStackSize(player.inventory.currentItem, 1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
return true;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return super.activate(player, part, item);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return super.activate(player, part, item);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -131,13 +131,13 @@ public class PartFramedWire extends PartAdvancedWire implements TSlottedPart, JN
|
||||||
System.out.println(this.getNetwork());
|
System.out.println(this.getNetwork());
|
||||||
}
|
}
|
||||||
|
|
||||||
TileMultipart tile = tile();
|
|
||||||
World w = world();
|
|
||||||
|
|
||||||
if (item != null)
|
if (item != null)
|
||||||
{
|
{
|
||||||
if (item.getItem().itemID == Block.lever.blockID)
|
if (item.getItem().itemID == Block.lever.blockID)
|
||||||
{
|
{
|
||||||
|
TileMultipart tile = tile();
|
||||||
|
World w = world();
|
||||||
|
|
||||||
if (!w.isRemote)
|
if (!w.isRemote)
|
||||||
{
|
{
|
||||||
PartFramedSwitchWire wire = (PartFramedSwitchWire) MultiPartRegistry.createPart("resonant_induction_switch_wire", false);
|
PartFramedSwitchWire wire = (PartFramedSwitchWire) MultiPartRegistry.createPart("resonant_induction_switch_wire", false);
|
||||||
|
|
Loading…
Reference in a new issue