32 lines
1.1 KiB
Java
32 lines
1.1 KiB
Java
package net.paladrill.paladrillmod.procedure;
|
|
|
|
import net.paladrill.paladrillmod.ElementsPaladrillmodMod;
|
|
|
|
import net.minecraft.entity.player.EntityPlayer;
|
|
import net.minecraft.entity.EntityLivingBase;
|
|
import net.minecraft.entity.Entity;
|
|
|
|
import java.util.Map;
|
|
|
|
@ElementsPaladrillmodMod.ModElement.Tag
|
|
public class ProcedureAngelicWaterMobplayerCollidesBlock extends ElementsPaladrillmodMod.ModElement {
|
|
public ProcedureAngelicWaterMobplayerCollidesBlock(ElementsPaladrillmodMod instance) {
|
|
super(instance, 166);
|
|
}
|
|
|
|
public static void executeProcedure(Map<String, Object> dependencies) {
|
|
if (dependencies.get("entity") == null) {
|
|
System.err.println("Failed to load dependency entity for procedure AngelicWaterMobplayerCollidesBlock!");
|
|
return;
|
|
}
|
|
Entity entity = (Entity) dependencies.get("entity");
|
|
if ((entity instanceof EntityPlayer)) {
|
|
if ((Math.random() < 0.5)) {
|
|
if (entity instanceof EntityLivingBase)
|
|
((EntityLivingBase) entity)
|
|
.setHealth((float) (((entity instanceof EntityLivingBase) ? ((EntityLivingBase) entity).getHealth() : -1) + 1.5));
|
|
}
|
|
}
|
|
}
|
|
}
|