fix getEnergyProvider compat hook, fix stripes block placing eating items

This commit is contained in:
Adrian 2015-06-12 11:27:39 +02:00
parent 30d90f48b5
commit cc6fc2324c
2 changed files with 9 additions and 2 deletions

View file

@ -112,8 +112,11 @@ public class PipeTransportPower extends PipeTransport implements IDebuggable {
// Disregard engines for this. // Disregard engines for this.
return false; return false;
} }
if (tile instanceof IEnergyHandler || tile instanceof IEnergyReceiver) {
IEnergyConnection handler = (IEnergyConnection) tile; Object provider = CompatHooks.INSTANCE.getEnergyProvider(tile);
if (provider instanceof IEnergyHandler || provider instanceof IEnergyReceiver) {
IEnergyConnection handler = (IEnergyConnection) provider;
if (handler.canConnectEnergy(side.getOpposite())) { if (handler.canConnectEnergy(side.getOpposite())) {
return true; return true;
} }

View file

@ -41,6 +41,10 @@ public class StripesHandlerPlaceBlock implements IStripesHandler {
src.orientation = direction; src.orientation = direction;
src.moveBackwards(1.0D); src.moveBackwards(1.0D);
if (stack.tryPlaceItemIntoWorld(player, world, (int) src.x, (int) src.y, (int) src.z, direction.ordinal(), 0.0f, 0.0f, 0.0f)) { if (stack.tryPlaceItemIntoWorld(player, world, (int) src.x, (int) src.y, (int) src.z, direction.ordinal(), 0.0f, 0.0f, 0.0f)) {
if (stack.stackSize > 0) {
activator.sendItem(stack, direction.getOpposite());
}
return true; return true;
} }
} }