Guest User

Untitled

a guest
Aug 27th, 2015
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.07 KB | None | 0 0
  1. package com.mierzen.recall.handlers;
  2.  
  3. import com.mierzen.recall.ExtendedPlayer;
  4. import com.mierzen.recall.Recall;
  5. import com.mierzen.recall.packets.MessageSyncPlayerProps;
  6. import cpw.mods.fml.common.eventhandler.SubscribeEvent;
  7. import net.minecraft.entity.player.EntityPlayer;
  8. import net.minecraft.entity.player.EntityPlayerMP;
  9. import net.minecraftforge.event.entity.EntityEvent;
  10. import net.minecraftforge.event.entity.EntityJoinWorldEvent;
  11.  
  12. public class ExtendedPlayerHandler
  13. {
  14.     @SubscribeEvent
  15.     public void onEvent(EntityEvent.EntityConstructing event)
  16.     {
  17.         if ((event.entity instanceof EntityPlayer) && (ExtendedPlayer.get((EntityPlayer)event.entity) == null))
  18.         {
  19.             ExtendedPlayer.register((EntityPlayer)event.entity);
  20.         }
  21.     }
  22.  
  23.     @SubscribeEvent
  24.     public void onEvent(EntityJoinWorldEvent event)
  25.     {
  26.         if ((event.entity instanceof EntityPlayer && !event.entity.worldObj.isRemote))
  27.             Recall.network.sendTo(new MessageSyncPlayerProps((EntityPlayer)event.entity), (EntityPlayerMP)event.entity);
  28.     }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment