Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 24 additions & 4 deletions src/main/java/cam72cam/immersiverailroading/tile/TileRailBase.java
Original file line number Diff line number Diff line change
Expand Up @@ -667,7 +667,12 @@ public void update() {
break;
}
for (Facing side : Facing.values()) {
IInventory inventory = getWorld().getInventory(getPos().offset(side));
Vec3i pos = getPos().offset(side);
if (BlockUtil.isIRRail(getWorld(), pos)) {
// Can't transfer to another rail augment directly
continue;
}
IInventory inventory = getWorld().getInventory(pos);
if (inventory != null) {
inventory.transferAllTo(freight.cargoItems);
}
Expand All @@ -681,7 +686,12 @@ public void update() {
break;
}
for (Facing side : Facing.values()) {
IInventory inventory = getWorld().getInventory(getPos().offset(side));
Vec3i pos = getPos().offset(side);
if (BlockUtil.isIRRail(getWorld(), pos)) {
// Can't transfer to another rail augment directly
continue;
}
IInventory inventory = getWorld().getInventory(pos);
if (inventory != null) {
inventory.transferAllFrom(freight.cargoItems);
}
Expand All @@ -695,7 +705,12 @@ public void update() {
break;
}
for (Facing side : Facing.values()) {
List<ITank> tanks = getWorld().getTank(getPos().offset(side));
Vec3i pos = getPos().offset(side);
if (BlockUtil.isIRRail(getWorld(), pos)) {
// Can't transfer to another rail augment directly
continue;
}
List<ITank> tanks = getWorld().getTank(pos);
if (tanks != null) {
tanks.forEach(tank -> stock.theTank.drain(tank, 100, false));
}
Expand All @@ -709,7 +724,12 @@ public void update() {
break;
}
for (Facing side : Facing.values()) {
List<ITank> tanks = getWorld().getTank(getPos().offset(side));
Vec3i pos = getPos().offset(side);
if (BlockUtil.isIRRail(getWorld(), pos)) {
// Can't transfer to another rail augment directly
continue;
}
List<ITank> tanks = getWorld().getTank(pos);
if (tanks != null) {
tanks.forEach(tank -> stock.theTank.fill(tank, 100, false));
}
Expand Down