mirror of
https://github.com/Thorfusion/Mekanism-Community-Edition.git
synced 2026-11-22 04:52:25 +00:00
Major packet improvements - trying to get on the good side of server owners. More to come.
Instead of sending to all players in a dimension or within a defined range, packets will now only be sent to players who have the chunk loaded that the packet is being sent from on the server.
This commit is contained in:
1 parent
14b40d901a
commit
1fd5e498e8
20 files changed
+99
-54
No files matched your search
@@ -9,6 +9,7 @@ import java.util.Set;
|
||||
import mekanism.api.Coord4D;
|
||||
import mekanism.api.IConfigurable;
|
||||
import mekanism.api.ISalinationSolar;
|
||||
import mekanism.api.Range4D;
|
||||
import mekanism.common.Mekanism;
|
||||
import mekanism.common.network.PacketTileEntity.TileEntityMessage;
|
||||
import mekanism.common.tank.TankUpdateProtocol;
|
||||
@@ -114,7 +115,7 @@ public class TileEntitySalinationController extends TileEntitySalinationTank imp
|
||||
{
|
||||
if(Math.abs((float)waterTank.getFluidAmount()/waterTank.getCapacity()-prevScale) > 0.01)
|
||||
{
|
||||
Mekanism.packetHandler.sendToAllAround(new TileEntityMessage(Coord4D.get(this), getNetworkedData(new ArrayList())), Coord4D.get(this).getTargetPoint(50D));
|
||||
Mekanism.packetHandler.sendToReceivers(new TileEntityMessage(Coord4D.get(this), getNetworkedData(new ArrayList())), new Range4D(Coord4D.get(this)));
|
||||
prevScale = (float)waterTank.getFluidAmount()/waterTank.getCapacity();
|
||||
}
|
||||
}
|
||||
@@ -150,7 +151,7 @@ public class TileEntitySalinationController extends TileEntitySalinationTank imp
|
||||
|
||||
if(structured != prev)
|
||||
{
|
||||
Mekanism.packetHandler.sendToAllAround(new TileEntityMessage(Coord4D.get(this), getNetworkedData(new ArrayList())), Coord4D.get(this).getTargetPoint(50D));
|
||||
Mekanism.packetHandler.sendToReceivers(new TileEntityMessage(Coord4D.get(this), getNetworkedData(new ArrayList())), new Range4D(Coord4D.get(this)));
|
||||
}
|
||||
|
||||
if(structured)
|
||||
|
||||
Reference in new issue
Block a user