Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Override
- public void onArmorTick(World world, EntityPlayer player, ItemStack itemStack){
- {
- if(player.capabilities.allowFlying == false){
- player.capabilities.allowFlying=true;
- }
- }
- }
- /**
- * Called each tick as long the item is on a player inventory. Uses by maps to check if is on a player hand and
- * update it's contents.
- */
- public void onUpdate(ItemStack itemstack, World world, Entity entity, int p_77663_4_, boolean p_77663_5_){
- {
- if (entity != null)
- {
- if(entity instanceof EntityPlayer)
- {
- EntityPlayer player = ((EntityPlayer)entity);
- if(player.inventory.armorItemInSlot(2) == null){
- if(player.capabilities.allowFlying == true){
- player.capabilities.allowFlying = false;
- }
- }else if(player.inventory.armorItemInSlot(2).getItem() != mcreator_armorname.body){
- if(player.capabilities.allowFlying == true){
- player.capabilities.allowFlying = false;
- }
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement