Breaking
This commit is contained in:
@@ -298,6 +298,6 @@ public class RefinedStorageUtils {
|
||||
}
|
||||
|
||||
public static void reRenderBlock(World world, BlockPos pos) {
|
||||
world.notifyBlockUpdate(pos, world.getBlockState(pos), world.getBlockState(pos), 1 | 2);
|
||||
world.notifyBlockUpdate(pos, world.getBlockState(pos), world.getBlockState(pos), 2 | 4);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@ public abstract class BlockMachine extends BlockBase {
|
||||
super.onNeighborBlockChange(world, pos, state, neighborBlock);
|
||||
|
||||
if (!world.isRemote) {
|
||||
((TileMachine) world.getTileEntity(pos)).searchController();
|
||||
((TileMachine) world.getTileEntity(pos)).searchController(world);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -102,7 +102,7 @@ public class TileController extends TileBase implements IEnergyReceiver, ISynchr
|
||||
List<IStorage> newStorages = new ArrayList<IStorage>();
|
||||
List<CraftingPattern> newPatterns = new ArrayList<CraftingPattern>();
|
||||
|
||||
if (canRun()) {
|
||||
//if (canRun()) {
|
||||
newEnergyUsage = 10;
|
||||
|
||||
for (TileMachine machine : machines) {
|
||||
@@ -171,9 +171,9 @@ public class TileController extends TileBase implements IEnergyReceiver, ISynchr
|
||||
craftingTaskIterator.remove();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
/*} else {
|
||||
disconnectAll();
|
||||
}
|
||||
}*/
|
||||
|
||||
wirelessGridRange = newWirelessGridRange;
|
||||
energyUsage = newEnergyUsage;
|
||||
@@ -208,7 +208,7 @@ public class TileController extends TileBase implements IEnergyReceiver, ISynchr
|
||||
break;
|
||||
}
|
||||
|
||||
if (lastEnergy != energy.getEnergyStored()) {
|
||||
if (lastEnergy != energy.getEnergyStored() || ticks == 1) {
|
||||
worldObj.updateComparatorOutputLevel(pos, RefinedStorageBlocks.CONTROLLER);
|
||||
|
||||
if (System.currentTimeMillis() - lastEnergyUpdate > 3000L) {
|
||||
@@ -216,8 +216,6 @@ public class TileController extends TileBase implements IEnergyReceiver, ISynchr
|
||||
|
||||
lastEnergyUpdate = System.currentTimeMillis();
|
||||
}
|
||||
} else if (ticks < 10) {
|
||||
RefinedStorageUtils.sendToAllAround(worldObj, pos, new MessageControllerEnergyUpdate(this));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import io.netty.buffer.ByteBuf;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import refinedstorage.RefinedStorageUtils;
|
||||
import refinedstorage.block.BlockMachine;
|
||||
import refinedstorage.network.MessageMachineConnectedUpdate;
|
||||
@@ -25,7 +26,14 @@ public abstract class TileMachine extends TileBase implements ISynchronizedConta
|
||||
return controller;
|
||||
}
|
||||
|
||||
public void searchController() {
|
||||
// We use a world parameter here and not worldObj because in BlockMachine.onNeighborBlockChange
|
||||
// this method is called and at that point in time worldObj is not set yet.
|
||||
public void searchController(World world) {
|
||||
// @TODO: Give onConnected and onDisconnected a world param
|
||||
if (worldObj == null) {
|
||||
worldObj = world;
|
||||
}
|
||||
|
||||
visited.clear();
|
||||
|
||||
TileController newController = ControllerSearcher.search(worldObj, pos, visited);
|
||||
@@ -49,7 +57,7 @@ public abstract class TileMachine extends TileBase implements ISynchronizedConta
|
||||
if (ticks == 1) {
|
||||
block = worldObj.getBlockState(pos).getBlock();
|
||||
|
||||
searchController();
|
||||
searchController(worldObj);
|
||||
}
|
||||
|
||||
if (connected && !redstoneMode.isEnabled(worldObj, pos)) {
|
||||
|
||||
Reference in New Issue
Block a user