Updated some textures + made controller update more frequent

This commit is contained in:
Raoul Van den Berge
2016-06-21 21:36:23 +02:00
parent e3280ddb31
commit 32b130619f
7 changed files with 20 additions and 11 deletions

View File

@@ -54,6 +54,7 @@ public class NetworkMaster {
private List<IStorage> storages = new ArrayList<IStorage>();
private List<BlockPos> slaves = new ArrayList<BlockPos>();
private Map<BlockPos, Boolean> slaveConnectivity = new HashMap<BlockPos, Boolean>();
private List<BlockPos> slavesToAdd = new ArrayList<BlockPos>();
private List<BlockPos> slavesToLoad = new ArrayList<BlockPos>();
private List<BlockPos> slavesToRemove = new ArrayList<BlockPos>();
@@ -146,6 +147,16 @@ public class NetworkMaster {
if (slave.canUpdate()) {
slave.updateSlave();
}
boolean active = slave.canUpdate();
if (!slaveConnectivity.containsKey(slave.getPosition()) || slaveConnectivity.get(slave.getPosition()) != active) {
slaveConnectivity.put(slave.getPosition(), active);
if (slave.canSendConnectivityUpdate()) {
RefinedStorageUtils.updateBlock(world, slave.getPosition());
}
}
}
for (ICraftingTask taskToCancel : craftingTasksToCancel) {
@@ -200,7 +211,7 @@ public class NetworkMaster {
if (energy.getEnergyStored() != lastEnergy) {
world.updateComparatorOutputLevel(pos, RefinedStorageBlocks.CONTROLLER);
if (System.currentTimeMillis() - lastEnergyUpdate > 5000) {
if (System.currentTimeMillis() - lastEnergyUpdate > 2500) {
lastEnergyUpdate = System.currentTimeMillis();
RefinedStorageUtils.updateBlock(world, pos);

View File

@@ -26,7 +26,6 @@ public abstract class TileSlave extends TileBase implements ISynchronizedContain
protected RedstoneMode redstoneMode = RedstoneMode.IGNORE;
protected NetworkMaster network;
private boolean wasActive;
private Set<String> visited = new HashSet<String>();
@Override
@@ -43,15 +42,6 @@ public abstract class TileSlave extends TileBase implements ISynchronizedContain
return true;
}
@Override
public void update() {
if (canSendConnectivityUpdate() && wasActive != isActive()) {
wasActive = isActive();
RefinedStorageUtils.updateBlock(worldObj, pos);
}
}
@Override
public void connect(World world, NetworkMaster network) {
if (network.canRun()) {
@@ -61,6 +51,10 @@ public abstract class TileSlave extends TileBase implements ISynchronizedContain
this.network.addSlave(pos);
world.notifyNeighborsOfStateChange(pos, getBlockType());
if (canSendConnectivityUpdate()) {
RefinedStorageUtils.updateBlock(world, pos);
}
}
}
@@ -80,6 +74,10 @@ public abstract class TileSlave extends TileBase implements ISynchronizedContain
}
world.notifyNeighborsOfStateChange(pos, getBlockType());
if (canSendConnectivityUpdate()) {
RefinedStorageUtils.updateBlock(world, pos);
}
}
@Override

Binary file not shown.

Before

Width:  |  Height:  |  Size: 428 B

After

Width:  |  Height:  |  Size: 448 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 661 B

After

Width:  |  Height:  |  Size: 646 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 583 B

After

Width:  |  Height:  |  Size: 640 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 618 B

After

Width:  |  Height:  |  Size: 618 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 689 B

After

Width:  |  Height:  |  Size: 535 B