2015-11-02 12:39:44 -08:00
|
|
|
package WayofTime.bloodmagic.network;
|
2015-10-30 16:54:59 -07:00
|
|
|
|
2015-11-02 12:39:44 -08:00
|
|
|
import WayofTime.bloodmagic.BloodMagic;
|
|
|
|
import WayofTime.bloodmagic.util.ChatUtil;
|
2015-10-30 16:54:59 -07:00
|
|
|
import net.minecraft.entity.player.EntityPlayerMP;
|
|
|
|
import net.minecraft.tileentity.TileEntity;
|
|
|
|
import net.minecraftforge.fml.common.network.NetworkRegistry;
|
|
|
|
import net.minecraftforge.fml.common.network.simpleimpl.IMessage;
|
|
|
|
import net.minecraftforge.fml.common.network.simpleimpl.SimpleNetworkWrapper;
|
|
|
|
import net.minecraftforge.fml.relauncher.Side;
|
|
|
|
|
2015-11-27 20:15:19 -05:00
|
|
|
public class BloodMagicPacketHandler {
|
2015-10-30 16:54:59 -07:00
|
|
|
|
2015-11-02 12:39:44 -08:00
|
|
|
public static final SimpleNetworkWrapper INSTANCE = new SimpleNetworkWrapper(BloodMagic.MODID);
|
2015-10-30 16:54:59 -07:00
|
|
|
|
|
|
|
public static void init() {
|
|
|
|
INSTANCE.registerMessage(ChatUtil.PacketNoSpamChat.Handler.class, ChatUtil.PacketNoSpamChat.class, 0, Side.CLIENT);
|
|
|
|
}
|
|
|
|
|
|
|
|
public static void sendToAllAround(IMessage message, TileEntity te, int range) {
|
|
|
|
INSTANCE.sendToAllAround(message, new NetworkRegistry.TargetPoint(te.getWorld().provider.getDimensionId(), te.getPos().getX(), te.getPos().getY(), te.getPos().getZ(), range));
|
|
|
|
}
|
|
|
|
|
|
|
|
public static void sendToAllAround(IMessage message, TileEntity te) {
|
|
|
|
sendToAllAround(message, te, 64);
|
|
|
|
}
|
|
|
|
|
|
|
|
public static void sendTo(IMessage message, EntityPlayerMP player) {
|
|
|
|
INSTANCE.sendTo(message, player);
|
|
|
|
}
|
|
|
|
}
|