Added method to send crafting monitor update. It's no longer being sent every tick. Crafting tasks need to call this accordingly.
This commit is contained in:
@@ -222,6 +222,11 @@ public interface INetworkMaster {
|
|||||||
*/
|
*/
|
||||||
void sendFluidStorageDeltaToClient(FluidStack stack, int delta);
|
void sendFluidStorageDeltaToClient(FluidStack stack, int delta);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sends a crafting monitor update to all players that are watching a crafting monitor.
|
||||||
|
*/
|
||||||
|
void sendCraftingMonitorUpdate();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Inserts an item in this network.
|
* Inserts an item in this network.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -197,6 +197,8 @@ public class TileController extends TileBase implements INetworkMaster, IEnergyR
|
|||||||
|
|
||||||
private boolean couldRun;
|
private boolean couldRun;
|
||||||
|
|
||||||
|
private boolean craftingMonitorUpdateRequested;
|
||||||
|
|
||||||
private EnumControllerType type;
|
private EnumControllerType type;
|
||||||
|
|
||||||
private RedstoneMode redstoneMode = RedstoneMode.IGNORE;
|
private RedstoneMode redstoneMode = RedstoneMode.IGNORE;
|
||||||
@@ -294,10 +296,22 @@ public class TileController extends TileBase implements INetworkMaster, IEnergyR
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!craftingTasks.isEmpty() || craftingTasksChanged) {
|
if (craftingTasksChanged) {
|
||||||
markDirty();
|
craftingMonitorUpdateRequested = true;
|
||||||
|
}
|
||||||
|
|
||||||
updateCraftingMonitors();
|
if (!craftingTasks.isEmpty()) {
|
||||||
|
markDirty();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (craftingMonitorUpdateRequested) {
|
||||||
|
craftingMonitorUpdateRequested = false;
|
||||||
|
|
||||||
|
for (INetworkNode node : nodeGraph.all()) {
|
||||||
|
if (node instanceof TileCraftingMonitor) {
|
||||||
|
((TileCraftingMonitor) node).dataManager.sendParameterToWatchers(TileCraftingMonitor.ELEMENTS);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -331,12 +345,9 @@ public class TileController extends TileBase implements INetworkMaster, IEnergyR
|
|||||||
super.update();
|
super.update();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void updateCraftingMonitors() {
|
@Override
|
||||||
for (INetworkNode node : nodeGraph.all()) {
|
public void sendCraftingMonitorUpdate() {
|
||||||
if (node instanceof TileCraftingMonitor) {
|
craftingMonitorUpdateRequested = true;
|
||||||
((TileCraftingMonitor) node).dataManager.sendParameterToWatchers(TileCraftingMonitor.ELEMENTS);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user