mirror of
https://github.com/GTNewHorizons/EnderIO.git
synced 2026-11-26 15:03:07 +00:00
31 lines
923 B
Java
31 lines
923 B
Java
package crazypants.enderio.network;
|
|
|
|
import net.minecraft.tileentity.TileEntity;
|
|
import cpw.mods.fml.common.network.NetworkRegistry;
|
|
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
|
import cpw.mods.fml.common.network.simpleimpl.IMessage;
|
|
import cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper;
|
|
|
|
public class PacketHandler
|
|
{
|
|
|
|
public static final SimpleNetworkWrapper INSTANCE = NetworkRegistry.INSTANCE.newSimpleChannel("enderio");
|
|
|
|
private static int ID = 0;
|
|
|
|
public static int nextID()
|
|
{
|
|
return ID++;
|
|
}
|
|
|
|
public static void sendToAllAround(IMessage message, TileEntity te, int range)
|
|
{
|
|
INSTANCE.sendToAllAround(message, new TargetPoint(te.getWorldObj().provider.dimensionId, te.xCoord, te.yCoord, te.zCoord, range));
|
|
}
|
|
|
|
public static void sendToAllAround(IMessage message, TileEntity te)
|
|
{
|
|
sendToAllAround(message, te, 16);
|
|
}
|
|
}
|