Remove useless checks
This commit is contained in:
@@ -20,7 +20,7 @@ public class NetworkNodeListener {
|
||||
|
||||
if (e.phase == TickEvent.Phase.END) {
|
||||
for (INetworkNode node : API.instance().getNetworkNodeManager(e.world).all()) {
|
||||
if (node.getWorld() != null && e.world.isBlockLoaded(node.getPos())) {
|
||||
if (e.world.isBlockLoaded(node.getPos())) {
|
||||
node.update();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -75,7 +75,7 @@ public abstract class NetworkNode implements INetworkNode, INetworkNeighborhoodA
|
||||
|
||||
@Override
|
||||
public void markDirty() {
|
||||
if (world != null && !world.isRemote) {
|
||||
if (!world.isRemote) {
|
||||
API.instance().getNetworkNodeManager(world).markForSaving();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,20 +27,12 @@ public class NetworkNodeCrafter extends NetworkNode implements ICraftingPatternC
|
||||
private static final String NBT_TRIGGERED_AUTOCRAFTING = "TriggeredAutocrafting";
|
||||
private static final String NBT_BLOCKED = "Blocked";
|
||||
|
||||
private ItemHandlerBase patterns = new ItemHandlerBase(9, new ItemHandlerListenerNetworkNode(this), s -> {
|
||||
// We can only validate the crafting pattern if the world exists.
|
||||
// If the world doesn't exist, this is probably called while reading and in that case it doesn't matter.
|
||||
if (world != null) {
|
||||
return s.getItem() instanceof ICraftingPatternProvider && ((ICraftingPatternProvider) s.getItem()).create(world, s, this).isValid();
|
||||
}
|
||||
|
||||
return true;
|
||||
}) {
|
||||
private ItemHandlerBase patterns = new ItemHandlerBase(9, new ItemHandlerListenerNetworkNode(this), s -> s.getItem() instanceof ICraftingPatternProvider && ((ICraftingPatternProvider) s.getItem()).create(world, s, this).isValid()) {
|
||||
@Override
|
||||
protected void onContentsChanged(int slot) {
|
||||
super.onContentsChanged(slot);
|
||||
|
||||
if (world != null && !world.isRemote) {
|
||||
if (!world.isRemote) {
|
||||
rebuildPatterns();
|
||||
}
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ public class NetworkNodeFluidInterface extends NetworkNode implements IComparabl
|
||||
protected void onContentsChanged() {
|
||||
super.onContentsChanged();
|
||||
|
||||
if (world != null && !world.isRemote) {
|
||||
if (!world.isRemote) {
|
||||
((TileFluidInterface) world.getTileEntity(pos)).getDataManager().sendParameterToWatchers(TileFluidInterface.TANK_IN);
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ public class NetworkNodeFluidInterface extends NetworkNode implements IComparabl
|
||||
protected void onContentsChanged() {
|
||||
super.onContentsChanged();
|
||||
|
||||
if (world != null && !world.isRemote) {
|
||||
if (!world.isRemote) {
|
||||
((TileFluidInterface) world.getTileEntity(pos)).getDataManager().sendParameterToWatchers(TileFluidInterface.TANK_OUT);
|
||||
}
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ public class NetworkNodeSecurityManager extends NetworkNode implements ISecurity
|
||||
protected void onContentsChanged(int slot) {
|
||||
super.onContentsChanged(slot);
|
||||
|
||||
if (world != null && !world.isRemote) {
|
||||
if (!world.isRemote) {
|
||||
rebuildCards();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user