diff options
| author | Jason Mitchell <mitchej@gmail.com> | 2018-09-03 00:57:51 -0700 |
|---|---|---|
| committer | Jason Mitchell <mitchej@gmail.com> | 2018-09-03 00:57:51 -0700 |
| commit | 1698e57f729efb52e2b98e865a9671f0b50a5b2e (patch) | |
| tree | 09b81c4c89478b2e392f7b482eedb064ac520eee /src/main/java/gregtech/common/blocks | |
| parent | 9d530773035ad21cffb1f558fa8309a57021c3b2 (diff) | |
| download | GT5-Unofficial-1698e57f729efb52e2b98e865a9671f0b50a5b2e.tar.gz GT5-Unofficial-1698e57f729efb52e2b98e865a9671f0b50a5b2e.tar.bz2 GT5-Unofficial-1698e57f729efb52e2b98e865a9671f0b50a5b2e.zip | |
Pipe/Cable overhaul & Add filter output on fluid filters
* Unified connect() method for pipes/wires - each subclass has it's own canConnect(), letsIn(), and letsOut() methods that map to the specifics for that implementation
* Shift Clicking while placing a GT machine will now try connecting to the cable/pipe it is placed on
* You can open a connection to the air for pipes & wires, allowing the next thing you place down to auto connect (ie: a JABBA barrel)
* Distribute Fluids - Modeled after several of the upstream PRs
* Fluid regulators on pipes should stop spazzing out now
* Fluid filter covers - Now work with filtering output
BUG/TODO:
* Spray paint doesn't seem to keep wires/pipes from connecting properly
* Spray paint on wires/pipes should force a disconnection check
Diffstat (limited to 'src/main/java/gregtech/common/blocks')
| -rw-r--r-- | src/main/java/gregtech/common/blocks/GT_Item_Machines.java | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/main/java/gregtech/common/blocks/GT_Item_Machines.java b/src/main/java/gregtech/common/blocks/GT_Item_Machines.java index a742994ddc..1fa33e2a1d 100644 --- a/src/main/java/gregtech/common/blocks/GT_Item_Machines.java +++ b/src/main/java/gregtech/common/blocks/GT_Item_Machines.java @@ -158,8 +158,16 @@ public class GT_Item_Machines tTileEntity.setOwnerName(aPlayer.getDisplayName());
}
tTileEntity.getMetaTileEntity().initDefaultModes(aStack.getTagCompound());
+ final byte aSide = GT_Utility.getOppositeSide(side);
if (tTileEntity.getMetaTileEntity() instanceof IConnectable) {
- ((IConnectable) tTileEntity.getMetaTileEntity()).connect(GT_Utility.getOppositeSide(side));
+ // If we're connectable, try connecting to whatever we're up against
+ ((IConnectable) tTileEntity.getMetaTileEntity()).connect(aSide);
+ } else if (aPlayer != null && aPlayer.isSneaking()) {
+ // If we're being placed against something that is connectable, try telling it to connect to us
+ IGregTechTileEntity aTileEntity = tTileEntity.getIGregTechTileEntityAtSide(aSide);
+ if (aTileEntity != null && aTileEntity.getMetaTileEntity() instanceof IConnectable) {
+ ((IConnectable) aTileEntity.getMetaTileEntity()).connect((byte)side);
+ }
}
}
} else if (!aWorld.setBlock(aX, aY, aZ, this.field_150939_a, tDamage, 3)) {
|
