mirror of
https://github.com/Thorfusion/Mekanism-Community-Edition.git
synced 2026-11-23 21:39:40 +00:00
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:
1 parent
55e8980b4a
commit
4dd1e81c27
74 files changed
+196
-289
No files matched your search
@@ -2,8 +2,6 @@ package mekanism.common.network;
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import mekanism.api.Coord4D;
|
||||
import mekanism.api.Range4D;
|
||||
import mekanism.api.TileNetworkList;
|
||||
import mekanism.api.transmitters.TransmissionType;
|
||||
import mekanism.common.Mekanism;
|
||||
import mekanism.common.PacketHandler;
|
||||
@@ -49,7 +47,7 @@ public class PacketConfigurationUpdate implements IMessageHandler<ConfigurationU
|
||||
}
|
||||
|
||||
tile.markDirty();
|
||||
Mekanism.packetHandler.sendToReceivers(new TileEntityMessage(message.coord4D, network.getNetworkedData(new TileNetworkList())), new Range4D(message.coord4D));
|
||||
Mekanism.packetHandler.sendToAllTracking(new TileEntityMessage(message.coord4D, network.getNetworkedData()), message.coord4D);
|
||||
//Notify the neighbor on that side our state changed
|
||||
MekanismUtils.notifyNeighborOfChange(tile.getWorld(), message.configIndex, tile.getPos());
|
||||
} else if (message.packetType == ConfigurationPacket.EJECT_COLOR) {
|
||||
@@ -75,7 +73,7 @@ public class PacketConfigurationUpdate implements IMessageHandler<ConfigurationU
|
||||
config.getEjector().setStrictInput(!config.getEjector().hasStrictInput());
|
||||
}
|
||||
for (EntityPlayer p : ((TileEntityBasicBlock) config).playersUsing) {
|
||||
Mekanism.packetHandler.sendTo(new TileEntityMessage(message.coord4D, network.getNetworkedData(new TileNetworkList())), (EntityPlayerMP) p);
|
||||
Mekanism.packetHandler.sendTo(new TileEntityMessage(message.coord4D, network.getNetworkedData()), (EntityPlayerMP) p);
|
||||
}
|
||||
}
|
||||
}, player);
|
||||
|
||||
Reference in new issue
Block a user