Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @SubscribeEvent
- public void attachCapability(AttachCapabilitiesEvent.Entity event)
- {
- if (!(event.getEntity() instanceof EntityPlayer))
- return;
- if (event.getEntity().hasCapability(DisguiseProvider.DISGUISE, null)) {
- System.out.println("Player already has capability");
- return;
- }
- event.addCapability(new ResourceLocation(Utils.MODID, "idisguise"), new DisguiseProvider());
- }
- @SubscribeEvent
- public void onPlayerClone(PlayerEvent.Clone event)
- {
- EntityPlayer player = event.getEntityPlayer();
- IDisguise render = player.getCapability(DisguiseProvider.DISGUISE, null);
- IDisguise oldRender = event.getOriginal().getCapability(DisguiseProvider.DISGUISE, null);
- render.setID(oldRender.getID());
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement