use of net.minecraft.entity.monster.EntityPolarBear in project Bewitchment by Um-Mitternacht.
the class BloodEvents method onJoin.
@SubscribeEvent
public static void onJoin(EntityJoinWorldEvent evt) {
Entity e = evt.getEntity();
if (!e.world.isRemote && e instanceof EntityLivingBase) {
IBloodReserve br = e.getCapability(CapabilityBloodReserve.CAPABILITY, null);
if (br.getMaxBlood() == 0) {
int maxBlood = 100;
if (e instanceof EntityPlayer) {
maxBlood = 480;
} else if (e instanceof EntityVillager) {
maxBlood = 240;
} else if (e instanceof EntityCow || e instanceof EntityHorse || e instanceof EntityPolarBear) {
maxBlood = 150;
} else if (e instanceof EntityDonkey || e instanceof EntityLlama) {
maxBlood = 130;
} else if (e instanceof EntitySheep) {
maxBlood = 110;
} else if (e instanceof EntityWolf || e instanceof EntityOcelot) {
maxBlood = 80;
} else if (e instanceof EntityChicken || e instanceof EntityParrot) {
maxBlood = 50;
} else {
maxBlood = -1;
}
br.setMaxBlood(maxBlood);
br.setBlood(maxBlood);
EntityLivingBase ent = (EntityLivingBase) e;
NetworkHandler.HANDLER.sendToAllAround(new EntityInternalBloodChanged(ent), new TargetPoint(e.dimension, ent.posX, ent.posY, ent.posZ, 32));
} else {
EntityLivingBase ent = (EntityLivingBase) e;
NetworkHandler.HANDLER.sendToAllAround(new EntityInternalBloodChanged(ent), new TargetPoint(e.dimension, ent.posX, ent.posY, ent.posZ, 32));
}
}
}
Aggregations