Merge branch 'master' of https://bitbucket.org/AlgorithmX2/appliedenergistics2
This commit is contained in:
@@ -170,25 +170,28 @@ public class CableBusContainer implements AEMultiTile, ICableBusContainer
|
||||
is.stackSize = 1;
|
||||
|
||||
IPart bp = bi.createPartFromItemStack( is );
|
||||
if ( bp instanceof IPartCable )
|
||||
if ( bp != null )
|
||||
{
|
||||
boolean canPlace = true;
|
||||
for (ForgeDirection d : ForgeDirection.VALID_DIRECTIONS)
|
||||
if ( getPart( d ) != null && !getPart( d ).canBePlacedOn( ((IPartCable) bp).supportsBuses() ) )
|
||||
canPlace = false;
|
||||
if ( bp instanceof IPartCable )
|
||||
{
|
||||
boolean canPlace = true;
|
||||
for (ForgeDirection d : ForgeDirection.VALID_DIRECTIONS)
|
||||
if ( getPart( d ) != null && !getPart( d ).canBePlacedOn( ((IPartCable) bp).supportsBuses() ) )
|
||||
canPlace = false;
|
||||
|
||||
if ( !canPlace )
|
||||
return false;
|
||||
if ( !canPlace )
|
||||
return false;
|
||||
|
||||
return getPart( ForgeDirection.UNKNOWN ) == null;
|
||||
}
|
||||
else if ( !(bp instanceof IPartCable) && side != ForgeDirection.UNKNOWN )
|
||||
{
|
||||
IPart cable = getPart( ForgeDirection.UNKNOWN );
|
||||
if ( cable != null && !bp.canBePlacedOn( ((IPartCable) cable).supportsBuses() ) )
|
||||
return false;
|
||||
return getPart( ForgeDirection.UNKNOWN ) == null;
|
||||
}
|
||||
else if ( !(bp instanceof IPartCable) && side != ForgeDirection.UNKNOWN )
|
||||
{
|
||||
IPart cable = getPart( ForgeDirection.UNKNOWN );
|
||||
if ( cable != null && !bp.canBePlacedOn( ((IPartCable) cable).supportsBuses() ) )
|
||||
return false;
|
||||
|
||||
return getPart( side ) == null;
|
||||
return getPart( side ) == null;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
@@ -701,7 +704,7 @@ public class CableBusContainer implements AEMultiTile, ICableBusContainer
|
||||
p.readFromNBT( extra );
|
||||
}
|
||||
else
|
||||
throw new RuntimeException( "Invalid NBT For CableBus Container." );
|
||||
throw new RuntimeException( "Invalid NBT For CableBus Container: " + iss.getItem().getClass().getName() + " is not a valid part." );
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
@@ -28,6 +28,7 @@ import appeng.api.parts.SelectedPart;
|
||||
import appeng.core.AELog;
|
||||
import appeng.core.AppEng;
|
||||
import appeng.core.sync.network.NetworkHandler;
|
||||
import appeng.core.sync.packets.PacketClick;
|
||||
import appeng.core.sync.packets.PacketPartPlacement;
|
||||
import appeng.facade.IFacadeItem;
|
||||
import appeng.integration.abstraction.IBC;
|
||||
@@ -61,6 +62,21 @@ public class PartPlacement
|
||||
if ( te instanceof IPartHost )
|
||||
event.setCanceled( true );
|
||||
}
|
||||
else if ( event.entityPlayer != null )
|
||||
{
|
||||
ItemStack held = event.entityPlayer.getHeldItem();
|
||||
if ( event.entityPlayer.isSneaking() && held != null && AEApi.instance().items().itemMemoryCard.sameAs( held ) )
|
||||
{
|
||||
try
|
||||
{
|
||||
NetworkHandler.instance.sendToServer( new PacketClick( event.x, event.y, event.z, event.face, 0, 0, 0 ) );
|
||||
}
|
||||
catch (IOException e)
|
||||
{
|
||||
// :P
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if ( event.action == Action.RIGHT_CLICK_BLOCK && event.entityPlayer.worldObj.isRemote )
|
||||
{
|
||||
|
||||
@@ -388,8 +388,28 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine
|
||||
worked = true;
|
||||
if ( type == Actionable.MODULATE )
|
||||
{
|
||||
i.onItemUse( is, player, w, x, y, z, side.ordinal(), side.offsetX, side.offsetY, side.offsetZ );
|
||||
maxStorage = maxStorage - is.stackSize;
|
||||
if ( i instanceof IPlantable )
|
||||
{
|
||||
boolean Worked = false;
|
||||
|
||||
if ( Worked == false && side.offsetX == 0 && side.offsetZ == 0 )
|
||||
Worked = i.onItemUse( is, player, w, x + side.offsetX, y + side.offsetY, z + side.offsetZ, side.getOpposite().ordinal(),
|
||||
side.offsetX, side.offsetY, side.offsetZ );
|
||||
|
||||
if ( Worked == false && side.offsetY == 0 )
|
||||
Worked = i.onItemUse( is, player, w, x, y - 1, z, ForgeDirection.UP.ordinal(), side.offsetX, side.offsetY, side.offsetZ );
|
||||
|
||||
if ( Worked == false )
|
||||
Worked = i.onItemUse( is, player, w, x, y, z, side.getOpposite().ordinal(), side.offsetX, side.offsetY, side.offsetZ );
|
||||
|
||||
if ( Worked )
|
||||
maxStorage = maxStorage - is.stackSize;
|
||||
}
|
||||
else
|
||||
{
|
||||
i.onItemUse( is, player, w, x, y, z, side.getOpposite().ordinal(), side.offsetX, side.offsetY, side.offsetZ );
|
||||
maxStorage = maxStorage - is.stackSize;
|
||||
}
|
||||
}
|
||||
else
|
||||
maxStorage = 1;
|
||||
|
||||
@@ -241,7 +241,7 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC
|
||||
monitor = null;
|
||||
if ( target != null )
|
||||
{
|
||||
IExternalStorageHandler esh = AEApi.instance().registries().externalStorage().getHandler( target, side.getOpposite(), StorageChannel.ITEMS );
|
||||
IExternalStorageHandler esh = AEApi.instance().registries().externalStorage().getHandler( target, side.getOpposite(), StorageChannel.ITEMS, mySrc );
|
||||
if ( esh != null )
|
||||
{
|
||||
IMEInventory inv = esh.getInventory( target, side.getOpposite(), StorageChannel.ITEMS, mySrc );
|
||||
|
||||
Reference in New Issue
Block a user