Files
mc/mods/pala/legacy-src-backup/net/paladrill/paladrillmod/procedure/ProcedureStickOfGodRightClickedInAir.java

83 lines
3.6 KiB
Java

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 ProcedureStickOfGodRightClickedInAir extends ElementsPaladrillmodMod.ModElement {
public ProcedureStickOfGodRightClickedInAir(ElementsPaladrillmodMod instance) {
super(instance, 227);
}
public static void executeProcedure(Map<String, Object> dependencies) {
if (dependencies.get("entity") == null) {
System.err.println("Failed to load dependency entity for procedure StickOfGodRightClickedInAir!");
return;
}
if (dependencies.get("itemstack") == null) {
System.err.println("Failed to load dependency itemstack for procedure StickOfGodRightClickedInAir!");
return;
}
if (dependencies.get("x") == null) {
System.err.println("Failed to load dependency x for procedure StickOfGodRightClickedInAir!");
return;
}
if (dependencies.get("y") == null) {
System.err.println("Failed to load dependency y for procedure StickOfGodRightClickedInAir!");
return;
}
if (dependencies.get("z") == null) {
System.err.println("Failed to load dependency z for procedure StickOfGodRightClickedInAir!");
return;
}
if (dependencies.get("world") == null) {
System.err.println("Failed to load dependency world for procedure StickOfGodRightClickedInAir!");
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.DRAGON_BREATH, x, y, z, (int) 60, 3, 3, 3, 1, new int[0]);
if (world instanceof WorldServer)
((WorldServer) world).spawnParticle(EnumParticleTypes.LAVA, 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.enderdragon.ambient")),
SoundCategory.NEUTRAL, (float) 1, (float) 1);
if (entity instanceof EntityLivingBase)
((EntityLivingBase) entity).addPotionEffect(new PotionEffect(MobEffects.SPEED, (int) 60, (int) 5, (false), (false)));
if (entity instanceof EntityLivingBase)
((EntityLivingBase) entity).addPotionEffect(new PotionEffect(MobEffects.STRENGTH, (int) 80, (int) 2, (false), (false)));
if (entity instanceof EntityLivingBase)
((EntityLivingBase) entity).addPotionEffect(new PotionEffect(MobEffects.SATURATION, (int) 240, (int) 2, (false), (false)));
if (entity instanceof EntityLivingBase)
((EntityLivingBase) entity).addPotionEffect(new PotionEffect(MobEffects.REGENERATION, (int) 60, (int) 1, (false), (false)));
}
}