Use sendToAllTracking for update packets (#5496)

* Don't check Y height for sending update packets. Seems to fix compat with cubic chunks #5262

* First pass transitioning from using sendToReceivers to using built in forge stuff

* Make code cleaner to read with helper methods

* Fix accidental extra code from a local branch issue I had

* Further improve readability

* Rename method

* shortcut if player not in same dimension & use EMP.server for the reference
This commit is contained in:
Richard Freimer authored and Xander committed 2019-06-08 16:51:37 +08:00
1 parent 55e8980b4a
commit 4dd1e81c27
74 files changed
+196 -289

No files matched your search

@@ -11,7 +11,6 @@ import java.util.Set;
import javax.annotation.Nonnull;
import mekanism.api.Coord4D;
import mekanism.api.EnumColor;
import mekanism.api.Range4D;
import mekanism.api.TileNetworkList;
import mekanism.common.Mekanism;
import mekanism.common.base.ILogisticalTransporter;
@@ -186,7 +185,7 @@ public class TransporterImpl extends TransmitterImpl<TileEntity, InventoryNetwor
needsSync.clear();
// Finally, notify clients and mark chunk for save
Mekanism.packetHandler.sendToReceivers(msg, new Range4D(coord));
Mekanism.packetHandler.sendToAllTracking(msg, coord);
MekanismUtils.saveChunk(getTileEntity());
}
}
@@ -244,7 +243,7 @@ public class TransporterImpl extends TransmitterImpl<TileEntity, InventoryNetwor
int stackId = nextId++;
transit.put(stackId, stack);
Coord4D coord = coord();
Mekanism.packetHandler.sendToReceivers(new TileEntityMessage(coord, getTileEntity().makeSyncPacket(stackId, stack)), new Range4D(coord));
Mekanism.packetHandler.sendToAllTracking(new TileEntityMessage(coord, getTileEntity().makeSyncPacket(stackId, stack)), coord);
MekanismUtils.saveChunk(getTileEntity());
}
return response;