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

88 lines
3.4 KiB
Java

package net.paladrill.paladrillmod.procedure;
import net.paladrill.paladrillmod.ElementsPaladrillmodMod;
import net.minecraft.world.World;
import net.minecraft.util.text.TextComponentString;
import net.minecraft.util.math.BlockPos;
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 net.minecraft.block.material.Material;
import java.util.Random;
import java.util.Map;
@ElementsPaladrillmodMod.ModElement.Tag
public class ProcedureWeightedBootsBootsTickEvent extends ElementsPaladrillmodMod.ModElement {
public ProcedureWeightedBootsBootsTickEvent(ElementsPaladrillmodMod instance) {
super(instance, 250);
}
public static void executeProcedure(Map<String, Object> dependencies) {
if (dependencies.get("entity") == null) {
System.err.println("Failed to load dependency entity for procedure WeightedBootsBootsTickEvent!");
return;
}
if (dependencies.get("itemstack") == null) {
System.err.println("Failed to load dependency itemstack for procedure WeightedBootsBootsTickEvent!");
return;
}
if (dependencies.get("x") == null) {
System.err.println("Failed to load dependency x for procedure WeightedBootsBootsTickEvent!");
return;
}
if (dependencies.get("y") == null) {
System.err.println("Failed to load dependency y for procedure WeightedBootsBootsTickEvent!");
return;
}
if (dependencies.get("z") == null) {
System.err.println("Failed to load dependency z for procedure WeightedBootsBootsTickEvent!");
return;
}
if (dependencies.get("world") == null) {
System.err.println("Failed to load dependency world for procedure WeightedBootsBootsTickEvent!");
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");
boolean logique = false;
double number = 0;
number = (double) 0;
if ((((world.getBlockState(new BlockPos((int) x, (int) (y - 3), (int) z))).getMaterial() == Material.AIR)
&& (entity instanceof EntityPlayer))) {
if (entity instanceof EntityLivingBase)
((EntityLivingBase) entity).addPotionEffect(new PotionEffect(MobEffects.RESISTANCE, (int) 10, (int) 15, (false), (false)));
if (entity instanceof EntityLivingBase)
((EntityLivingBase) entity).addPotionEffect(new PotionEffect(MobEffects.LEVITATION, (int) 10, (int) (-75), (false), (false)));
number = (double) 0;
} else {
number = (double) 1;
if (((!((world.getBlockState(new BlockPos((int) x, (int) (y - 2), (int) z))).getMaterial() == Material.AIR))
&& (((number) == 1) && ((entity instanceof EntityPlayer) && ((entity.motionY) < (-2)))))) {
if (!world.isRemote) {
world.createExplosion(null, (int) x, (int) y, (int) z, (float) (Math.abs((entity.motionY)) + 0.25), true);
}
if (entity instanceof EntityPlayer && !entity.world.isRemote) {
((EntityPlayer) entity).sendStatusMessage(new TextComponentString(("" + ("\u00A7l\u00A7cEXPLOSION !!!!"))), (true));
}
number = (double) 0;
{
ItemStack _ist = (itemstack);
if (_ist.attemptDamageItem((int) 1, new Random(), null)) {
_ist.shrink(1);
_ist.setItemDamage(0);
}
}
}
}
}
}