package net.paladrill.paladrillmod.procedure; import net.paladrill.paladrillmod.ElementsPaladrillmodMod; import net.minecraft.world.WorldServer; import net.minecraft.world.World; import net.minecraft.util.SoundCategory; import net.minecraft.util.ResourceLocation; import net.minecraft.util.EnumParticleTypes; import net.minecraft.potion.PotionEffect; import net.minecraft.item.ItemStack; import net.minecraft.init.MobEffects; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.Entity; import java.util.Random; import java.util.Map; @ElementsPaladrillmodMod.ModElement.Tag public class ProcedureStrenghStickRightClickedInAir extends ElementsPaladrillmodMod.ModElement { public ProcedureStrenghStickRightClickedInAir(ElementsPaladrillmodMod instance) { super(instance, 228); } public static void executeProcedure(Map dependencies) { if (dependencies.get("entity") == null) { System.err.println("Failed to load dependency entity for procedure StrenghStickRightClickedInAir!"); return; } if (dependencies.get("itemstack") == null) { System.err.println("Failed to load dependency itemstack for procedure StrenghStickRightClickedInAir!"); return; } if (dependencies.get("x") == null) { System.err.println("Failed to load dependency x for procedure StrenghStickRightClickedInAir!"); return; } if (dependencies.get("y") == null) { System.err.println("Failed to load dependency y for procedure StrenghStickRightClickedInAir!"); return; } if (dependencies.get("z") == null) { System.err.println("Failed to load dependency z for procedure StrenghStickRightClickedInAir!"); return; } if (dependencies.get("world") == null) { System.err.println("Failed to load dependency world for procedure StrenghStickRightClickedInAir!"); return; } Entity entity = (Entity) dependencies.get("entity"); ItemStack itemstack = (ItemStack) dependencies.get("itemstack"); int x = (int) dependencies.get("x"); int y = (int) dependencies.get("y"); int z = (int) dependencies.get("z"); World world = (World) dependencies.get("world"); if (entity instanceof EntityPlayer) ((EntityPlayer) entity).getCooldownTracker().setCooldown(((itemstack)).getItem(), (int) 100); { ItemStack _ist = (itemstack); if (_ist.attemptDamageItem((int) 1, new Random(), null)) { _ist.shrink(1); _ist.setItemDamage(0); } } if (world instanceof WorldServer) ((WorldServer) world).spawnParticle(EnumParticleTypes.CRIT_MAGIC, x, y, z, (int) 60, 3, 3, 3, 1, new int[0]); if (world instanceof WorldServer) ((WorldServer) world).spawnParticle(EnumParticleTypes.CRIT, x, y, z, (int) 60, 3, 3, 3, 1, new int[0]); world.playSound((EntityPlayer) null, x, y, z, (net.minecraft.util.SoundEvent) net.minecraft.util.SoundEvent.REGISTRY.getObject(new ResourceLocation("entity.wither.shoot")), SoundCategory.NEUTRAL, (float) 1, (float) 1); if (entity instanceof EntityLivingBase) ((EntityLivingBase) entity).addPotionEffect(new PotionEffect(MobEffects.STRENGTH, (int) 60, (int) 3, (false), (false))); } }