Fixed RP2 wires connecting to normal pipes
This commit is contained in:
parent
b2ec6d6ae8
commit
a39924a5a4
7 changed files with 55 additions and 13 deletions
|
@ -40,7 +40,7 @@ import net.minecraft.src.World;
|
|||
|
||||
public class BlockGenericPipe extends BlockContainer {
|
||||
|
||||
/** Defined subprograms **************************************************/
|
||||
/* Defined subprograms **************************************************/
|
||||
|
||||
public BlockGenericPipe(int i) {
|
||||
super(i, Material.glass);
|
||||
|
@ -261,7 +261,7 @@ public class BlockGenericPipe extends BlockContainer {
|
|||
return pipe.itemID;
|
||||
}
|
||||
|
||||
/** Wrappers *************************************************************/
|
||||
/* Wrappers *************************************************************/
|
||||
|
||||
@Override
|
||||
public void onNeighborBlockChange(World world, int x, int y, int z, int l) {
|
||||
|
@ -445,6 +445,17 @@ public class BlockGenericPipe extends BlockContainer {
|
|||
if (isValid(pipe))
|
||||
pipe.onEntityCollidedWithBlock(entity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canConnectRedstone(IBlockAccess world, int x, int y, int z, int side)
|
||||
{
|
||||
Pipe pipe = getPipe(world, x, y, z);
|
||||
|
||||
if (isValid(pipe))
|
||||
return pipe.canConnectRedstone()
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isPoweringTo(IBlockAccess iblockaccess, int x, int y, int z, int l) {
|
||||
|
@ -480,7 +491,7 @@ public class BlockGenericPipe extends BlockContainer {
|
|||
pipe.randomDisplayTick(random);
|
||||
}
|
||||
|
||||
/** Registration *********************************************************/
|
||||
/* Registration *********************************************************/
|
||||
|
||||
public static TreeMap<Integer, Class<? extends Pipe>> pipes = new TreeMap<Integer, Class<? extends Pipe>>();
|
||||
|
||||
|
|
|
@ -351,6 +351,13 @@ public abstract class Pipe implements IPipe, IDropControlInventory {
|
|||
public void onEntityCollidedWithBlock(Entity entity) {
|
||||
|
||||
}
|
||||
|
||||
public boolean canConnectRedstone() {
|
||||
if(hasGate())
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean isPoweringTo(int l) {
|
||||
if (!broadcastRedstone)
|
||||
|
@ -487,15 +494,15 @@ public abstract class Pipe implements IPipe, IDropControlInventory {
|
|||
public void resetGate() {
|
||||
gate = null;
|
||||
activatedTriggers = new Trigger[activatedTriggers.length];
|
||||
triggerParameters = new ITriggerParameter[triggerParameters.length];
|
||||
activatedActions = new Action[activatedActions.length];
|
||||
broadcastSignal = new boolean[] { false, false, false, false };
|
||||
if (broadcastRedstone) {
|
||||
updateNeighbors(true);
|
||||
}
|
||||
broadcastRedstone = false;
|
||||
triggerParameters = new ITriggerParameter[triggerParameters.length];
|
||||
activatedActions = new Action[activatedActions.length];
|
||||
broadcastSignal = new boolean[] { false, false, false, false };
|
||||
if (broadcastRedstone) {
|
||||
updateNeighbors(true);
|
||||
}
|
||||
broadcastRedstone = false;
|
||||
//worldObj.markBlockNeedsUpdate(xCoord, yCoord, zCoord);
|
||||
container.scheduleRenderUpdate();
|
||||
container.scheduleRenderUpdate();
|
||||
}
|
||||
|
||||
private void resolveActions() {
|
||||
|
|
|
@ -74,4 +74,9 @@ public class PipeItemsGold extends Pipe implements IPipeTransportItemsHook {
|
|||
public void readjustSpeed(IPipedItem item) {
|
||||
((PipeTransportItems) transport).defaultReajustSpeed(item);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canConnectRedstone() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -43,5 +43,8 @@ public class PipeItemsIron extends Pipe {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean canConnectRedstone() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -221,4 +221,10 @@ public class PipeItemsWood extends Pipe implements IPowerReceptor {
|
|||
return getPowerProvider().getMaxEnergyReceived();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canConnectRedstone() {
|
||||
if(PowerFramework.currentFramework instanceof RedstonePowerFramework)
|
||||
return true;
|
||||
return super.canConnectRedstone();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -41,5 +41,8 @@ public class PipeLiquidsIron extends Pipe {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean canConnectRedstone() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -136,4 +136,11 @@ public class PipeLiquidsWood extends Pipe implements IPowerReceptor {
|
|||
public int powerRequest() {
|
||||
return getPowerProvider().getMaxEnergyReceived();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canConnectRedstone() {
|
||||
if(PowerFramework.currentFramework instanceof RedstonePowerFramework)
|
||||
return true;
|
||||
return super.canConnectRedstone();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue