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

@@ -2,7 +2,6 @@ package mekanism.client.gui;
import java.io.IOException;
import java.util.Arrays;
import mekanism.api.Coord4D;
import mekanism.api.TileNetworkList;
import mekanism.api.gas.GasStack;
import mekanism.api.infuse.InfuseType;
@@ -136,7 +135,7 @@ public class GuiFactory extends GuiMekanismTile<TileEntityFactory> {
ItemStack stack = mc.player.inventory.getItemStack();
if (!stack.isEmpty() && stack.getItem() instanceof ItemGaugeDropper) {
TileNetworkList data = TileNetworkList.withContents(1);
Mekanism.packetHandler.sendToServer(new TileEntityMessage(Coord4D.get(tileEntity), data));
Mekanism.packetHandler.sendToServer(new TileEntityMessage(tileEntity, data));
SoundHandler.playSound(SoundEvents.UI_BUTTON_CLICK);
}
}