mirror of
https://github.com/Thorfusion/Mekanism-Community-Edition.git
synced 2026-11-22 12:59:41 +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
@@ -8,6 +8,7 @@ import java.util.HashSet;
|
||||
import java.util.List;
|
||||
|
||||
import mekanism.api.Coord4D;
|
||||
import mekanism.api.Range4D;
|
||||
import mekanism.common.ITileComponent;
|
||||
import mekanism.common.ITileNetwork;
|
||||
import mekanism.common.Mekanism;
|
||||
@@ -182,7 +183,7 @@ public abstract class TileEntityBasicBlock extends TileEntity implements IWrench
|
||||
|
||||
if(!(facing == clientFacing || worldObj.isRemote))
|
||||
{
|
||||
Mekanism.packetHandler.sendToDimension(new TileEntityMessage(Coord4D.get(this), getNetworkedData(new ArrayList())), worldObj.provider.dimensionId);
|
||||
Mekanism.packetHandler.sendToReceivers(new TileEntityMessage(Coord4D.get(this), getNetworkedData(new ArrayList())), new Range4D(Coord4D.get(this)));
|
||||
worldObj.notifyBlocksOfNeighborChange(xCoord, yCoord, zCoord, worldObj.getBlock(xCoord, yCoord, zCoord));
|
||||
clientFacing = facing;
|
||||
}
|
||||
@@ -233,7 +234,7 @@ public abstract class TileEntityBasicBlock extends TileEntity implements IWrench
|
||||
if(redstone != power)
|
||||
{
|
||||
redstone = power;
|
||||
Mekanism.packetHandler.sendToDimension(new TileEntityMessage(Coord4D.get(this), getNetworkedData(new ArrayList())), worldObj.provider.dimensionId);
|
||||
Mekanism.packetHandler.sendToReceivers(new TileEntityMessage(Coord4D.get(this), getNetworkedData(new ArrayList())), new Range4D(Coord4D.get(this)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user