2015-11-02 12:39:44 -08:00
|
|
|
package WayofTime.bloodmagic.network;
|
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;
|
2016-07-10 15:27:26 -04:00
|
|
|
import WayofTime.bloodmagic.api.Constants;
|
|
|
|
import WayofTime.bloodmagic.util.ChatUtil;
|
2015-10-30 16:54:59 -07:00
|
|
|
|
2015-12-30 15:34:40 -05:00
|
|
|
public class BloodMagicPacketHandler
|
|
|
|
{
|
2015-11-28 18:25:46 -08:00
|
|
|
public static final SimpleNetworkWrapper INSTANCE = new SimpleNetworkWrapper(Constants.Mod.MODID);
|
2015-10-30 16:54:59 -07:00
|
|
|
|
2015-12-30 15:34:40 -05:00
|
|
|
public static void init()
|
|
|
|
{
|
2015-10-30 16:54:59 -07:00
|
|
|
INSTANCE.registerMessage(ChatUtil.PacketNoSpamChat.Handler.class, ChatUtil.PacketNoSpamChat.class, 0, Side.CLIENT);
|
2016-01-14 11:06:50 -05:00
|
|
|
INSTANCE.registerMessage(ItemRouterButtonPacketProcessor.class, ItemRouterButtonPacketProcessor.class, 1, Side.SERVER);
|
2016-04-13 11:05:17 -04:00
|
|
|
INSTANCE.registerMessage(PlayerVelocityPacketProcessor.class, PlayerVelocityPacketProcessor.class, 2, Side.CLIENT);
|
2016-05-01 22:32:15 -04:00
|
|
|
INSTANCE.registerMessage(PlayerFallDistancePacketProcessor.class, PlayerFallDistancePacketProcessor.class, 3, Side.SERVER);
|
2016-06-07 18:50:41 -04:00
|
|
|
INSTANCE.registerMessage(SigilHoldingPacketProcessor.class, SigilHoldingPacketProcessor.class, 4, Side.SERVER);
|
|
|
|
INSTANCE.registerMessage(KeyProcessor.class, KeyProcessor.class, 5, Side.SERVER);
|
2016-07-10 15:27:26 -04:00
|
|
|
INSTANCE.registerMessage(DemonAuraPacketProcessor.class, DemonAuraPacketProcessor.class, 6, Side.CLIENT);
|
2016-08-31 16:19:20 -04:00
|
|
|
INSTANCE.registerMessage(ItemRouterAmountPacketProcessor.class, ItemRouterAmountPacketProcessor.class, 7, Side.SERVER);
|
2015-10-30 16:54:59 -07:00
|
|
|
}
|
|
|
|
|
2015-12-30 15:34:40 -05:00
|
|
|
public static void sendToAllAround(IMessage message, TileEntity te, int range)
|
|
|
|
{
|
2016-03-17 13:00:44 -07:00
|
|
|
INSTANCE.sendToAllAround(message, new NetworkRegistry.TargetPoint(te.getWorld().provider.getDimension(), te.getPos().getX(), te.getPos().getY(), te.getPos().getZ(), range));
|
2015-10-30 16:54:59 -07:00
|
|
|
}
|
|
|
|
|
2015-12-30 15:34:40 -05:00
|
|
|
public static void sendToAllAround(IMessage message, TileEntity te)
|
|
|
|
{
|
2015-10-30 16:54:59 -07:00
|
|
|
sendToAllAround(message, te, 64);
|
|
|
|
}
|
|
|
|
|
2015-12-30 15:34:40 -05:00
|
|
|
public static void sendTo(IMessage message, EntityPlayerMP player)
|
|
|
|
{
|
2015-10-30 16:54:59 -07:00
|
|
|
INSTANCE.sendTo(message, player);
|
|
|
|
}
|
|
|
|
}
|