Fixes
This commit is contained in:
@@ -20,8 +20,7 @@ public class ControllerSearcher {
|
||||
if (tile instanceof TileController) {
|
||||
return (TileController) tile;
|
||||
} else if (tile instanceof TileMachine) {
|
||||
// We need to have visited more than 1 tile so that the relay can find a controller for itself
|
||||
if (visited.size() > 1 && tile instanceof TileRelay && !((TileRelay) tile).isConnected()) {
|
||||
if (visited.size() > 1 && tile instanceof TileRelay && !((TileRelay) tile).mayUpdate()) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
@@ -104,7 +104,12 @@ public class TileController extends TileBase implements IEnergyReceiver, ISynchr
|
||||
super.update();
|
||||
|
||||
if (!worldObj.isRemote) {
|
||||
machines.addAll(machinesToAdd);
|
||||
// Prevent cache from re-adding the block
|
||||
for (TileMachine machine : machinesToAdd) {
|
||||
if (!machines.contains(machine)) {
|
||||
machines.add(machine);
|
||||
}
|
||||
}
|
||||
machinesToAdd.clear();
|
||||
|
||||
machines.removeAll(machinesToRemove);
|
||||
|
@@ -1,10 +1,13 @@
|
||||
package refinedstorage.tile;
|
||||
|
||||
import net.minecraft.inventory.Container;
|
||||
import refinedstorage.RefinedStorageBlocks;
|
||||
import refinedstorage.container.ContainerRelay;
|
||||
import refinedstorage.tile.config.RedstoneMode;
|
||||
|
||||
public class TileRelay extends TileMachine {
|
||||
private boolean couldUpdate;
|
||||
|
||||
public TileRelay() {
|
||||
this.redstoneMode = RedstoneMode.LOW;
|
||||
}
|
||||
@@ -18,6 +21,16 @@ public class TileRelay extends TileMachine {
|
||||
public void updateMachine() {
|
||||
}
|
||||
|
||||
public void update() {
|
||||
super.update();
|
||||
|
||||
if (connected && couldUpdate != mayUpdate()) {
|
||||
couldUpdate = mayUpdate();
|
||||
|
||||
worldObj.notifyNeighborsOfStateChange(pos, RefinedStorageBlocks.RELAY);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<? extends Container> getContainer() {
|
||||
return ContainerRelay.class;
|
||||
|
Reference in New Issue
Block a user