TechMage66

PlayerCloneEventHandler

Mar 12th, 2016
216
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.69 KB | None | 0 0
  1. package com.techmage.magetech.handler.event;
  2.  
  3. import com.techmage.magetech.entity.ExtendedPlayerProperties;
  4. import net.minecraft.nbt.NBTTagCompound;
  5. import net.minecraftforge.event.entity.player.PlayerEvent;
  6. import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
  7.  
  8. public class PlayerCloneEventHandler
  9. {
  10.     @SubscribeEvent
  11.     public void onClonePlayer(PlayerEvent.Clone event)
  12.     {
  13.         if(event.wasDeath)
  14.         {
  15.             NBTTagCompound nbtTagCompound = new NBTTagCompound();
  16.             ExtendedPlayerProperties.get(event.original).saveNBTData(nbtTagCompound);
  17.             ExtendedPlayerProperties.get(event.entityPlayer).loadNBTData(nbtTagCompound);
  18.         }
  19.     }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment