diff --git a/src/main/java/com/hbm/handler/EntityEffectHandler.java b/src/main/java/com/hbm/handler/EntityEffectHandler.java index bd4da49f7..0355027e2 100644 --- a/src/main/java/com/hbm/handler/EntityEffectHandler.java +++ b/src/main/java/com/hbm/handler/EntityEffectHandler.java @@ -33,7 +33,6 @@ import net.minecraft.potion.PotionEffect; import net.minecraft.util.DamageSource; import net.minecraft.util.MathHelper; import net.minecraft.world.World; -import net.minecraft.world.chunk.Chunk; public class EntityEffectHandler { @@ -121,25 +120,35 @@ public class EntityEffectHandler { return; Random rand = new Random(entity.getEntityId()); + + int r600 = rand.nextInt(600); + int r1200 = rand.nextInt(1200); - if(HbmLivingProps.getRadiation(entity) > 600 && (world.getTotalWorldTime() + rand.nextInt(600)) % 600 == 0) { + if(HbmLivingProps.getRadiation(entity) > 600) { - NBTTagCompound nbt = new NBTTagCompound(); - nbt.setString("type", "bloodvomit"); - nbt.setInteger("entity", entity.getEntityId()); - PacketDispatcher.wrapper.sendToAllAround(new AuxParticlePacketNT(nbt, 0, 0, 0), new TargetPoint(entity.dimension, entity.posX, entity.posY, entity.posZ, 25)); + if((world.getTotalWorldTime() + r600) % 600 < 20) { + NBTTagCompound nbt = new NBTTagCompound(); + nbt.setString("type", "bloodvomit"); + nbt.setInteger("entity", entity.getEntityId()); + PacketDispatcher.wrapper.sendToAllAround(new AuxParticlePacketNT(nbt, 0, 0, 0), new TargetPoint(entity.dimension, entity.posX, entity.posY, entity.posZ, 25)); + + if((world.getTotalWorldTime() + r600) % 600 == 1) { + world.playSoundEffect(ix, iy, iz, "hbm:entity.vomit", 1.0F, 1.0F); + entity.addPotionEffect(new PotionEffect(Potion.hunger.id, 60, 19)); + } + } - world.playSoundEffect(ix, iy, iz, "hbm:entity.vomit", 1.0F, 1.0F); - entity.addPotionEffect(new PotionEffect(Potion.hunger.id, 60, 19)); - } else if(HbmLivingProps.getRadiation(entity) > 200 && (world.getTotalWorldTime() + rand.nextInt(1200)) % 1200 == 0) { + } else if(HbmLivingProps.getRadiation(entity) > 200 && (world.getTotalWorldTime() + r1200) % 1200 < 20) { NBTTagCompound nbt = new NBTTagCompound(); nbt.setString("type", "vomit"); nbt.setInteger("entity", entity.getEntityId()); PacketDispatcher.wrapper.sendToAllAround(new AuxParticlePacketNT(nbt, 0, 0, 0), new TargetPoint(entity.dimension, entity.posX, entity.posY, entity.posZ, 25)); - world.playSoundEffect(ix, iy, iz, "hbm:entity.vomit", 1.0F, 1.0F); - entity.addPotionEffect(new PotionEffect(Potion.hunger.id, 60, 19)); + if((world.getTotalWorldTime() + r1200) % 1200 == 1) { + world.playSoundEffect(ix, iy, iz, "hbm:entity.vomit", 1.0F, 1.0F); + entity.addPotionEffect(new PotionEffect(Potion.hunger.id, 60, 19)); + } } @@ -281,6 +290,16 @@ public class EntityEffectHandler { entity.attackEntityFrom(DamageSource.magic, 2F); } + if(contagion < 30 * minute && (contagion + entity.getEntityId()) % 200 < 20) { + NBTTagCompound nbt = new NBTTagCompound(); + nbt.setString("type", "bloodvomit"); + nbt.setInteger("entity", entity.getEntityId()); + PacketDispatcher.wrapper.sendToAllAround(new AuxParticlePacketNT(nbt, 0, 0, 0), new TargetPoint(entity.dimension, entity.posX, entity.posY, entity.posZ, 25)); + + if((contagion + entity.getEntityId()) % 200 == 19) + world.playSoundEffect(entity.posX, entity.posY, entity.posZ, "hbm:entity.vomit", 1.0F, 1.0F); + } + //end of contagion, drop dead if(contagion == 0) { entity.attackEntityFrom(DamageSource.magic, 1000F); diff --git a/src/main/java/com/hbm/handler/HTTPHandler.java b/src/main/java/com/hbm/handler/HTTPHandler.java index 651c4691d..e12832267 100644 --- a/src/main/java/com/hbm/handler/HTTPHandler.java +++ b/src/main/java/com/hbm/handler/HTTPHandler.java @@ -3,7 +3,6 @@ package com.hbm.handler; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; -import java.net.MalformedURLException; import java.net.URL; import java.util.ArrayList; import java.util.List; diff --git a/src/main/java/com/hbm/items/special/ItemSyringe.java b/src/main/java/com/hbm/items/special/ItemSyringe.java index fa823b452..e1a78ac41 100644 --- a/src/main/java/com/hbm/items/special/ItemSyringe.java +++ b/src/main/java/com/hbm/items/special/ItemSyringe.java @@ -551,7 +551,9 @@ public class ItemSyringe extends Item { if(this == ModItems.syringe_mkunicorn) { if(!world.isRemote) { - HbmLivingProps.setContagion(entity, 3 * 60 * 60 * 20);; + HbmLivingProps.setContagion(entity, 3 * 60 * 60 * 20); + world.playSoundAtEntity(entity, "hbm:item.syringe", 1.0F, 1.0F); + stack.stackSize--; } } diff --git a/src/main/java/com/hbm/main/ClientProxy.java b/src/main/java/com/hbm/main/ClientProxy.java index f7bd9d631..06659d7e3 100644 --- a/src/main/java/com/hbm/main/ClientProxy.java +++ b/src/main/java/com/hbm/main/ClientProxy.java @@ -1282,13 +1282,13 @@ public class ClientProxy extends ServerProxy { if(e instanceof EntityLivingBase) { double ix = e.posX; - double iy = e.posY - e.getYOffset() + e.getEyeHeight() + 1; + double iy = e.posY - e.getYOffset() + e.getEyeHeight() + (e instanceof EntityPlayer ? 1 : 0); double iz = e.posZ; Vec3 vec = e.getLookVec(); for(int i = 0; i < 25; i++) { - EntityFX fx = new net.minecraft.client.particle.EntityBlockDustFX(world, ix, iy, iz, (vec.xCoord + rand.nextGaussian() * 0.2) * 0.2, (vec.yCoord + rand.nextGaussian() * 0.2) * 0.2, (vec.zCoord + rand.nextGaussian() * 0.2) * 0.2, Blocks.stained_hardened_clay, 13); + EntityFX fx = new net.minecraft.client.particle.EntityBlockDustFX(world, ix, iy, iz, (vec.xCoord + rand.nextGaussian() * 0.2) * 0.2, (vec.yCoord + rand.nextGaussian() * 0.2) * 0.2, (vec.zCoord + rand.nextGaussian() * 0.2) * 0.2, Blocks.stained_hardened_clay, (rand.nextBoolean() ? 5 : 13)); ReflectionHelper.setPrivateValue(EntityFX.class, fx, 150 + rand.nextInt(50), "particleMaxAge", "field_70547_e"); Minecraft.getMinecraft().effectRenderer.addEffect(fx); } @@ -1302,7 +1302,7 @@ public class ClientProxy extends ServerProxy { if(e instanceof EntityLivingBase) { double ix = e.posX; - double iy = e.posY - e.getYOffset() + e.getEyeHeight() + 1; + double iy = e.posY - e.getYOffset() + e.getEyeHeight() + (e instanceof EntityPlayer ? 1 : 0); double iz = e.posZ; Vec3 vec = e.getLookVec(); diff --git a/src/main/java/com/hbm/main/ModEventHandler.java b/src/main/java/com/hbm/main/ModEventHandler.java index 1298d8111..02396acef 100644 --- a/src/main/java/com/hbm/main/ModEventHandler.java +++ b/src/main/java/com/hbm/main/ModEventHandler.java @@ -33,7 +33,6 @@ import com.hbm.handler.ArmorModHandler; import com.hbm.handler.BossSpawnHandler; import com.hbm.handler.EntityEffectHandler; import com.hbm.handler.RadiationWorldHandler; -import com.hbm.handler.radiation.ChunkRadiationManager; import com.hbm.interfaces.IBomb; import com.hbm.handler.HTTPHandler; import com.hbm.items.IEquipReceiver; @@ -700,7 +699,7 @@ public class ModEventHandler { EntityLivingBase e = event.entityLiving; - if(HbmLivingProps.getContagion(e) > 0) + if(HbmLivingProps.getContagion(e) > 0 && event.ammount < 100) event.ammount *= 2F; for(int i = 1; i < 5; i++) {