mirror of
https://github.com/Thorfusion/Mekanism-Community-Edition.git
synced 2026-11-26 23:03:01 +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
@@ -7,6 +7,7 @@ import java.util.Random;
|
||||
import mekanism.api.Coord4D;
|
||||
import mekanism.api.EnumColor;
|
||||
import mekanism.api.IConfigurable;
|
||||
import mekanism.api.Range4D;
|
||||
import mekanism.common.IInvConfiguration;
|
||||
import mekanism.common.Mekanism;
|
||||
import mekanism.common.network.PacketTileEntity.TileEntityMessage;
|
||||
@@ -22,11 +23,10 @@ import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import buildcraft.api.tools.IToolWrench;
|
||||
import cpw.mods.fml.common.Optional.Interface;
|
||||
import cpw.mods.fml.common.Optional.Method;
|
||||
|
||||
import buildcraft.api.tools.IToolWrench;
|
||||
|
||||
@Interface(iface = "buildcraft.api.tools.IToolWrench", modid = "BuildCraftAPI|tools")
|
||||
public class ItemConfigurator extends ItemEnergized implements IToolWrench
|
||||
{
|
||||
@@ -101,7 +101,7 @@ public class ItemConfigurator extends ItemEnergized implements IToolWrench
|
||||
if(config instanceof TileEntityBasicBlock)
|
||||
{
|
||||
TileEntityBasicBlock tileEntity = (TileEntityBasicBlock)config;
|
||||
Mekanism.packetHandler.sendToAllAround(new TileEntityMessage(Coord4D.get(tileEntity), tileEntity.getNetworkedData(new ArrayList())), Coord4D.get(tileEntity).getTargetPoint(50D));
|
||||
Mekanism.packetHandler.sendToReceivers(new TileEntityMessage(Coord4D.get(tileEntity), tileEntity.getNetworkedData(new ArrayList())), new Range4D(Coord4D.get(tileEntity)));
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
Reference in new issue
Block a user