Merge pull request #341 from CovertJaguar/master

Fixed RP2 wires connecting to normal pipes
This commit is contained in:
CovertJaguar 2012-10-09 14:50:01 -07:00
commit 26278298b7
7 changed files with 55 additions and 13 deletions

View file

@ -40,7 +40,7 @@ import net.minecraft.src.World;
public class BlockGenericPipe extends BlockContainer { public class BlockGenericPipe extends BlockContainer {
/** Defined subprograms **************************************************/ /* Defined subprograms **************************************************/
public BlockGenericPipe(int i) { public BlockGenericPipe(int i) {
super(i, Material.glass); super(i, Material.glass);
@ -261,7 +261,7 @@ public class BlockGenericPipe extends BlockContainer {
return pipe.itemID; return pipe.itemID;
} }
/** Wrappers *************************************************************/ /* Wrappers *************************************************************/
@Override @Override
public void onNeighborBlockChange(World world, int x, int y, int z, int l) { public void onNeighborBlockChange(World world, int x, int y, int z, int l) {
@ -446,6 +446,17 @@ public class BlockGenericPipe extends BlockContainer {
pipe.onEntityCollidedWithBlock(entity); 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 @Override
public boolean isPoweringTo(IBlockAccess iblockaccess, int x, int y, int z, int l) { public boolean isPoweringTo(IBlockAccess iblockaccess, int x, int y, int z, int l) {
Pipe pipe = getPipe(iblockaccess, x, y, z); Pipe pipe = getPipe(iblockaccess, x, y, z);
@ -480,7 +491,7 @@ public class BlockGenericPipe extends BlockContainer {
pipe.randomDisplayTick(random); pipe.randomDisplayTick(random);
} }
/** Registration *********************************************************/ /* Registration *********************************************************/
public static TreeMap<Integer, Class<? extends Pipe>> pipes = new TreeMap<Integer, Class<? extends Pipe>>(); public static TreeMap<Integer, Class<? extends Pipe>> pipes = new TreeMap<Integer, Class<? extends Pipe>>();

View file

@ -352,6 +352,13 @@ public abstract class Pipe implements IPipe, IDropControlInventory {
} }
public boolean canConnectRedstone() {
if(hasGate())
return true;
return false;
}
public boolean isPoweringTo(int l) { public boolean isPoweringTo(int l) {
if (!broadcastRedstone) if (!broadcastRedstone)
return false; return false;

View file

@ -74,4 +74,9 @@ public class PipeItemsGold extends Pipe implements IPipeTransportItemsHook {
public void readjustSpeed(IPipedItem item) { public void readjustSpeed(IPipedItem item) {
((PipeTransportItems) transport).defaultReajustSpeed(item); ((PipeTransportItems) transport).defaultReajustSpeed(item);
} }
@Override
public boolean canConnectRedstone() {
return true;
}
} }

View file

@ -43,5 +43,8 @@ public class PipeItemsIron extends Pipe {
} }
} }
@Override
public boolean canConnectRedstone() {
return true;
}
} }

View file

@ -221,4 +221,10 @@ public class PipeItemsWood extends Pipe implements IPowerReceptor {
return getPowerProvider().getMaxEnergyReceived(); return getPowerProvider().getMaxEnergyReceived();
} }
@Override
public boolean canConnectRedstone() {
if(PowerFramework.currentFramework instanceof RedstonePowerFramework)
return true;
return super.canConnectRedstone();
}
} }

View file

@ -41,5 +41,8 @@ public class PipeLiquidsIron extends Pipe {
} }
} }
@Override
public boolean canConnectRedstone() {
return true;
}
} }

View file

@ -136,4 +136,11 @@ public class PipeLiquidsWood extends Pipe implements IPowerReceptor {
public int powerRequest() { public int powerRequest() {
return getPowerProvider().getMaxEnergyReceived(); return getPowerProvider().getMaxEnergyReceived();
} }
@Override
public boolean canConnectRedstone() {
if(PowerFramework.currentFramework instanceof RedstonePowerFramework)
return true;
return super.canConnectRedstone();
}
} }