Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.mierzen.recall.handlers;
- import com.mierzen.recall.ExtendedPlayer;
- import com.mierzen.recall.Recall;
- import com.mierzen.recall.packets.MessageSyncPlayerProps;
- import cpw.mods.fml.common.eventhandler.SubscribeEvent;
- import net.minecraft.entity.player.EntityPlayer;
- import net.minecraft.entity.player.EntityPlayerMP;
- import net.minecraftforge.event.entity.EntityEvent;
- import net.minecraftforge.event.entity.EntityJoinWorldEvent;
- public class ExtendedPlayerHandler
- {
- @SubscribeEvent
- public void onEvent(EntityEvent.EntityConstructing event)
- {
- if ((event.entity instanceof EntityPlayer) && (ExtendedPlayer.get((EntityPlayer)event.entity) == null))
- {
- ExtendedPlayer.register((EntityPlayer)event.entity);
- }
- }
- @SubscribeEvent
- public void onEvent(EntityJoinWorldEvent event)
- {
- if ((event.entity instanceof EntityPlayer && !event.entity.worldObj.isRemote))
- Recall.network.sendTo(new MessageSyncPlayerProps((EntityPlayer)event.entity), (EntityPlayerMP)event.entity);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment