public class Reference {
	public static final String MOD_ID = "zombieinfection";
	public static final String MOD_NAME = "Zombie Infection";
	public static final String MINECRAFT_VERSION = "1.12";
	public static final String VERSION = "3.0.0";
	public static final String CLIENT_PROXY = "com.zalthonethree.zombieinfection.proxy.ClientProxy";
	public static final String SERVER_PROXY = "com.zalthonethree.zombieinfection.proxy.ServerProxy";
	public static final String RESOURCE_PREFIX = MOD_ID + ":";
	
	public class IdTracking {
		public static final int BOOK = 1;
	}
} public class IdTracking {
	public static final int BOOK = 1;
} public class GuiEyeInfection extends Gui {
	private Minecraft minecraftInstance;
	private ResourceLocation uncracked = new ResourceLocation(Reference.MOD_ID.toLowerCase(), "textures/gui/eyeinfection.png");
	private ResourceLocation cracked = new ResourceLocation(Reference.MOD_ID.toLowerCase(), "textures/gui/eyeinfectioncracked.png");
	
	public GuiEyeInfection(Minecraft MC) {
		super();
		minecraftInstance = MC;
	}
	
	@SubscribeEvent(priority = EventPriority.NORMAL) public void onRender(RenderGameOverlayEvent.Pre event) {
		int timeInfected = TimeInfectedTrackingClient.getSecondsInfected();
		if (event.isCanceled() || event.getType() != ElementType.HOTBAR || timeInfected < 60) return;
		ScaledResolution sr = new ScaledResolution(minecraftInstance);
		
		GlStateManager.pushAttrib();
		GlStateManager.enableBlend();
		GlStateManager.depthMask(false);
		minecraftInstance.renderEngine.bindTexture(uncracked);
		drawModalRectWithCustomSizedTexture(0, 0, 0, 0, sr.getScaledWidth(), sr.getScaledHeight(), sr.getScaledWidth(), sr.getScaledHeight());
		if (timeInfected >= 120) {
			minecraftInstance.renderEngine.bindTexture(cracked);
			drawModalRectWithCustomSizedTexture(0, 0, 0, 0, sr.getScaledWidth(), sr.getScaledHeight(), sr.getScaledWidth(), sr.getScaledHeight());
		}
		GlStateManager.popAttrib();
	}
} public class KnowledgeBook extends GuiScreen {
	public static KnowledgeBook instance = new KnowledgeBook();
	private static final ResourceLocation background = new ResourceLocation("zombieinfection", "textures/gui/book.png");
	private GuiScreen currentPage;
	public static int[] topLeft = new int[] {0, 0};
	
	@Override public final void initGui() {
		super.initGui();
		currentPage = MainPage.instance;
		instance = this;
	}
	
	@Override public void drawScreen(int mouseX, int mouseY, float partialTicks) {
		GlStateManager.color(1F, 1F, 1F, 1F);
		mc.renderEngine.bindTexture(background);
		int xSize = 96;
		int ySize = 128;
		int xPos = width / 2 - xSize / 2;
		int yPos = height / 2 - ySize / 2;
		topLeft = new int[] {xPos - (xSize / 2), yPos};
		drawScaledCustomSizeModalRect(xPos - (xSize / 2), yPos, 0, 0, 256, 256, xSize, ySize, 256, 256);
		drawScaledCustomSizeModalRect(xPos + (xSize / 2), yPos, 0, 0, 256, 256, xSize, ySize, 256, 256);
		currentPage.drawScreen(mouseX, mouseY, partialTicks);
		super.drawScreen(mouseX, mouseY, partialTicks);
	}
	
	@Override protected void actionPerformed(GuiButton button) {
		
	}
	
	@Override public boolean doesGuiPauseGame() { return false; }
} @SideOnly(Side.CLIENT) public class ModelZombieSheep extends ModelQuadruped {
	private float headRotation;
	
	public ModelZombieSheep() {
		super(12, 0.0F);
		this.head = new ModelRenderer(this, 0, 0);
		this.head.addBox(-3.0F, -4.0F, -6.0F, 6, 6, 8, 0.0F);
		this.head.setRotationPoint(0.0F, 6.0F, -8.0F);
		this.body = new ModelRenderer(this, 28, 8);
		this.body.addBox(-4.0F, -10.0F, -7.0F, 8, 16, 6, 0.0F);
		this.body.setRotationPoint(0.0F, 5.0F, 2.0F);
	}
	
	@Override public void setRotationAngles(float p_78087_1_, float p_78087_2_, float p_78087_3_, float p_78087_4_, float p_78087_5_, float p_78087_6_, Entity entity) {
		super.setRotationAngles(p_78087_1_, p_78087_2_, p_78087_3_, p_78087_4_, p_78087_5_, p_78087_6_, entity);
		this.head.rotateAngleX = this.headRotation;
	}
} @SideOnly(Side.CLIENT) public class RenderZombieChicken extends RenderLiving<EntityZombieChicken> {
	private static final ResourceLocation zombiechickenTexture = new ResourceLocation(Reference.MOD_ID.toLowerCase(), "textures/entity/zombiechicken.png");
	
	public RenderZombieChicken(RenderManager manager, ModelBase model, float shadow) {
		super(manager, model, shadow);
	}
	
	@Override protected ResourceLocation getEntityTexture(EntityZombieChicken entity) {
		return zombiechickenTexture;
	}
	
	@Override protected float handleRotationFloat(EntityZombieChicken livingBase, float partialTicks) {
		float f1 = livingBase.lastWingRotation + (livingBase.wingRotation - livingBase.lastWingRotation) * partialTicks;
		float f2 = livingBase.lastDestPos + (livingBase.destPos - livingBase.lastDestPos) * partialTicks;
		return (MathHelper.sin(f1) + 1.0F) * f2;
	}
} @SideOnly(Side.CLIENT) public class RenderZombieCow extends RenderLiving<EntityZombieCow> {
	private static final ResourceLocation zombiecowTexture = new ResourceLocation(Reference.MOD_ID.toLowerCase(), "textures/entity/zombiecow.png");
	
	public RenderZombieCow(RenderManager manager, ModelBase model, float shadowSize) {
		super(manager, model, shadowSize);
	}
	
	@Override protected ResourceLocation getEntityTexture(EntityZombieCow entity) {
		return zombiecowTexture;
	}
} @SideOnly(Side.CLIENT) public class RenderZombiePig extends RenderLiving<EntityZombiePig> {
	private static final ResourceLocation zombiepigTexture = new ResourceLocation(Reference.MOD_ID.toLowerCase(), "textures/entity/zombiepig.png");
	
	public RenderZombiePig(RenderManager manager, ModelBase model, float shadow) {
		super(manager, model, shadow);
	}
	
	@Override protected ResourceLocation getEntityTexture(EntityZombiePig entity) {
		return zombiepigTexture;
	}
} @SideOnly(Side.CLIENT) public class RenderZombieSheep extends RenderLiving<EntityZombieSheep> {
	private static final ResourceLocation zombiesheepTexture = new ResourceLocation(Reference.MOD_ID.toLowerCase(), "textures/entity/zombiesheep.png");
	
	public RenderZombieSheep(RenderManager manager, ModelBase model, float shadow) {
		super(manager, model, shadow);
	}
	
	@Override protected ResourceLocation getEntityTexture(EntityZombieSheep entity) {
		return zombiesheepTexture;
	}
} public class EntityZombieChicken extends EntityMob implements IZombieInfectionMob {
	public float wingRotation;
	public float destPos;
	public float lastDestPos;
	public float lastWingRotation;
	public float wingRotDelta = 1.0F;
	
	public int timeUntilNextEgg;
	// TODO Possible zombieChickenZombie, ZombieChicken with baby zombie on back
	
	public EntityZombieChicken(World world) {
		super(world);
		this.setSize(0.3F, 0.7F); // If we were copying the chicken size this is wrong, it should be 0.4, 0.7.
		this.timeUntilNextEgg = this.rand.nextInt(6000) + 6000;
		this.tasks.addTask(0, new EntityAISwimming(this));
		this.tasks.addTask(2, new EntityAIWander(this, 1.0D));
		this.tasks.addTask(2, new EntityAIAttackMelee(this, 1.0D, false));
		this.tasks.addTask(3, new EntityAIAttackMelee(this, 1.0D, true));
		this.tasks.addTask(3, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F));
		this.tasks.addTask(4, new EntityAILookIdle(this));
		this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, true));
		this.targetTasks.addTask(2, new EntityAINearestAttackableTarget<EntityPlayer>(this, EntityPlayer.class, true));
		this.targetTasks.addTask(2, new EntityAINearestAttackableTarget<EntityChicken>(this, EntityChicken.class, false));
	}
	
	@Override public float getEyeHeight() {
		return this.height;
	}
	
	@Override protected void applyEntityAttributes() {
		super.applyEntityAttributes();
		this.getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(10.0D);
		this.getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.3D);
	}
	
	@Override public boolean attackEntityAsMob(Entity entity) {
		boolean flag = super.attackEntityAsMob(entity);
		
		if (flag) {
			int i = this.world.getDifficulty().getDifficultyId();
			
			if (this.getHeldItemMainhand() == null && this.isBurning() && this.rand.nextFloat() < (float) i * 0.3F) {
				entity.setFire(2 * i);
			}
		}
		
		return flag;
	}
	
	@Override protected SoundEvent getAmbientSound() { return SoundEvents.ENTITY_CHICKEN_AMBIENT; }
	@Override protected SoundEvent getHurtSound(DamageSource source) { return SoundEvents.ENTITY_CHICKEN_HURT; }
	@Override protected SoundEvent getDeathSound() { return SoundEvents.ENTITY_CHICKEN_DEATH; }
	

	@Override protected void playStepSound(BlockPos pos, Block blockIn) {
		this.playSound(SoundEvents.ENTITY_CHICKEN_STEP, 0.15F, 1.0F);
	}
	
	@Override protected float getSoundVolume() { return 0.4F; }
	@Override public EnumCreatureAttribute getCreatureAttribute() { return EnumCreatureAttribute.UNDEAD; }
	@Override protected Item getDropItem() { return Items.ROTTEN_FLESH; }
	
	@Override public void onLivingUpdate() {
		if (this.world.isDaytime() && !this.world.isRemote && !this.isChild()) {
			float f = this.getBrightness();
			
			if (f > 0.5F && this.rand.nextFloat() * 30.0F < (f - 0.4F) * 2.0F && this.world.canBlockSeeSky(new BlockPos(MathHelper.floor(this.posX), MathHelper.floor(this.posY), MathHelper.floor(this.posZ)))) {
				this.setFire(8);
			}
		}
		
		super.onLivingUpdate();
		
		this.lastWingRotation = this.wingRotation;
		this.lastDestPos = this.destPos;
		this.destPos = (float) ((double) this.destPos + (double) (this.onGround ? -1 : 4) * 0.3D);
		
		if (this.destPos < 0.0F) {
			this.destPos = 0.0F;
		}
		
		if (this.destPos > 1.0F) {
			this.destPos = 1.0F;
		}
		
		if (!this.onGround && this.wingRotDelta < 1.0F) {
			this.wingRotDelta = 1.0F;
		}
		
		this.wingRotDelta = (float) ((double) this.wingRotDelta * 0.9D);
		
		if (!this.onGround && this.motionY < 0.0D) {
			this.motionY *= 0.6D;
		}
		
		this.wingRotation += this.wingRotDelta * 2.0F;
		
		if (!this.world.isRemote && !this.isChild() && this.timeUntilNextEgg-- <= 0) {
			this.playSound(SoundEvents.ENTITY_CHICKEN_EGG, 1.0F, (this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F);
			this.dropItem(ModRegistry.INFECTED_EGG, 1);
			this.timeUntilNextEgg = this.rand.nextInt(6000) + 6000;
		}
	}
	
	@Override public void onKillEntity(EntityLivingBase entityLivingIn) {
		super.onKillEntity(entityLivingIn);
		
		if ((this.world.getDifficulty() == EnumDifficulty.NORMAL || this.world.getDifficulty() == EnumDifficulty.HARD && !entityLivingIn.isChild()) && entityLivingIn instanceof EntityChicken) {
			if (this.world.getDifficulty() != EnumDifficulty.HARD && this.rand.nextBoolean()) { return; }
			
			EntityZombieChicken entityzombiechicken = new EntityZombieChicken(this.world);
			entityzombiechicken.copyLocationAndAnglesFrom(entityLivingIn);
			this.world.removeEntity(entityLivingIn);
			entityzombiechicken.onInitialSpawn(this.world.getDifficultyForLocation(this.getPosition()), (IEntityLivingData) null);
			
			this.world.spawnEntity(entityzombiechicken);
		}
	}

	@Override public void writeEntityToNBT(NBTTagCompound tagCompound) {
		super.writeEntityToNBT(tagCompound);
		tagCompound.setInteger("EggLayTime", this.timeUntilNextEgg);
	}
	
	@Override public void readEntityFromNBT(NBTTagCompound tagCompound) {
		super.readEntityFromNBT(tagCompound);
		if (tagCompound.hasKey("EggLayTime")) {
			this.timeUntilNextEgg = tagCompound.getInteger("EggLayTime");
		}
	}
	
	@Override public int getPlayerInfectionChance() { return 10; }
} public class EntityZombieCow extends EntityMob implements IZombieInfectionMob {
	public EntityZombieCow(World world) {
		super(world);
		this.setSize(0.9F, 1.3F);
		this.tasks.addTask(0, new EntityAISwimming(this));
		this.tasks.addTask(2, new EntityAIWander(this, 1.0D));
		this.tasks.addTask(2, new EntityAIAttackMelee(this, 1.0D, false));
		this.tasks.addTask(3, new EntityAIAttackMelee(this, 1.0D, true));
		this.tasks.addTask(3, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F));
		this.tasks.addTask(4, new EntityAILookIdle(this));
		this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, true));
		this.targetTasks.addTask(2, new EntityAINearestAttackableTarget<EntityPlayer>(this, EntityPlayer.class, true));
		this.targetTasks.addTask(2, new EntityAINearestAttackableTarget<EntityCow>(this, EntityCow.class, false));
	}
	
	@Override protected void applyEntityAttributes() {
		super.applyEntityAttributes();
		this.getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(10.0D);
		this.getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.3D);
	}
	
	@Override public boolean attackEntityAsMob(Entity entity) {
		boolean flag = super.attackEntityAsMob(entity);
		
		if (flag) {
			int i = this.world.getDifficulty().getDifficultyId();
			
			if (this.getHeldItemMainhand() == null && this.isBurning() && this.rand.nextFloat() < (float) i * 0.3F) {
				entity.setFire(2 * i);
			}
		}
		
		return flag;
	}
	
	@Override protected SoundEvent getAmbientSound() { return SoundEvents.ENTITY_COW_AMBIENT; }
	@Override protected SoundEvent getHurtSound(DamageSource source) { return SoundEvents.ENTITY_COW_HURT; }
	@Override protected SoundEvent getDeathSound() { return SoundEvents.ENTITY_COW_DEATH; }
	
	@Override protected void playStepSound(BlockPos pos, Block blockIn) {
		this.playSound(SoundEvents.ENTITY_COW_STEP, 0.15F, 1.0F);
	}
	
	@Override protected float getSoundVolume() { return 0.4F; }
	
	@Override public EnumCreatureAttribute getCreatureAttribute() { return EnumCreatureAttribute.UNDEAD; }
	@Override protected Item getDropItem() { return Items.ROTTEN_FLESH; }
	
	@Override public void onLivingUpdate() {
		if (this.world.isDaytime() && !this.world.isRemote && !this.isChild()) {
			float f = this.getBrightness();
			
			if (f > 0.5F && this.rand.nextFloat() * 30.0F < (f - 0.4F) * 2.0F && this.world.canBlockSeeSky(new BlockPos(MathHelper.floor(this.posX), MathHelper.floor(this.posY), MathHelper.floor(this.posZ)))) {
				this.setFire(8);
			}
		}
		
		super.onLivingUpdate();
	}
	
	@Override public void onKillEntity(EntityLivingBase entityLivingIn) {
		super.onKillEntity(entityLivingIn);
		
		if ((this.world.getDifficulty() == EnumDifficulty.NORMAL || this.world.getDifficulty() == EnumDifficulty.HARD && !entityLivingIn.isChild()) && entityLivingIn instanceof EntityCow) {
			if (this.world.getDifficulty() != EnumDifficulty.HARD && this.rand.nextBoolean()) { return; }
			
			EntityZombieCow entityzombiecow = new EntityZombieCow(this.world);
			entityzombiecow.copyLocationAndAnglesFrom(entityLivingIn);
			this.world.removeEntity(entityLivingIn);
			entityzombiecow.onInitialSpawn(this.world.getDifficultyForLocation(this.getPosition()), (IEntityLivingData) null);
			
			this.world.spawnEntity(entityzombiecow);
		}
	}
	
	@Override public boolean processInteract(EntityPlayer player, EnumHand hand) {
		ItemStack stack = player.getHeldItem(hand);
		if (!stack.isEmpty() && stack.getItem() == Items.BUCKET) {
			if ((stack.getCount() - 1) == 1) {
				player.inventory.setInventorySlotContents(player.inventory.currentItem, new ItemStack(ModRegistry.INFECTED_MILK));
			} else if (!player.inventory.addItemStackToInventory(new ItemStack(Items.MILK_BUCKET))) {
				player.dropItem(new ItemStack(Items.MILK_BUCKET, 1, 0), false);
			}
			
			return true;
		} else {
			return super.processInteract(player, hand);
		}
	}
	
	@Override public int getPlayerInfectionChance() { return 10; }
} public class EntityZombiePig extends EntityMob implements IZombieInfectionMob{
	public EntityZombiePig(World world) {
		super(world);
		this.setSize(0.9F, 0.9F);
		this.tasks.addTask(0, new EntityAISwimming(this));
		this.tasks.addTask(2, new EntityAIWander(this, 1.0D));
		this.tasks.addTask(2, new EntityAIAttackMelee(this, 1.0D, false));
		this.tasks.addTask(3, new EntityAIAttackMelee(this, 1.0D, true));
		this.tasks.addTask(3, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F));
		this.tasks.addTask(4, new EntityAILookIdle(this));
		this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, true));
		this.targetTasks.addTask(2, new EntityAINearestAttackableTarget<EntityPlayer>(this, EntityPlayer.class, true));
		this.targetTasks.addTask(2, new EntityAINearestAttackableTarget<EntityPig>(this, EntityPig.class, false));
	}
	
	@Override protected void applyEntityAttributes() {
		super.applyEntityAttributes();
		this.getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(10.0D);
		this.getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.3D);
	}
	
	@Override public boolean attackEntityAsMob(Entity entity) {
		boolean flag = super.attackEntityAsMob(entity);
		
		if (flag) {
			int i = this.world.getDifficulty().getDifficultyId();
			
			if (this.getHeldItemMainhand() == null && this.isBurning() && this.rand.nextFloat() < (float) i * 0.3F) {
				entity.setFire(2 * i);
			}
		}
		
		return flag;
	}
	
	@Override protected SoundEvent getAmbientSound() { return SoundEvents.ENTITY_PIG_AMBIENT; }
	@Override protected SoundEvent getHurtSound(DamageSource source) { return SoundEvents.ENTITY_PIG_HURT; }
	@Override protected SoundEvent getDeathSound() { return SoundEvents.ENTITY_PIG_DEATH; }
	
	@Override protected void playStepSound(BlockPos pos, Block blockIn) {
		this.playSound(SoundEvents.ENTITY_PIG_STEP, 0.15F, 1.0F);
	}
	
	@Override protected float getSoundVolume() { return 0.4F; }
	@Override public EnumCreatureAttribute getCreatureAttribute() { return EnumCreatureAttribute.UNDEAD; }
	@Override protected Item getDropItem() { return Items.ROTTEN_FLESH; }
	
	@Override public void onLivingUpdate() {
		if (this.world.isDaytime() && !this.world.isRemote && !this.isChild()) {
			float f = this.getBrightness();
			
			if (f > 0.5F && this.rand.nextFloat() * 30.0F < (f - 0.4F) * 2.0F && this.world.canBlockSeeSky(new BlockPos(MathHelper.floor(this.posX), MathHelper.floor(this.posY), MathHelper.floor(this.posZ)))) {
				this.setFire(8);
			}
		}
		
		super.onLivingUpdate();
	}
	
	@Override public void onKillEntity(EntityLivingBase entityLivingIn) {
		super.onKillEntity(entityLivingIn);
		
		if ((this.world.getDifficulty() == EnumDifficulty.NORMAL || this.world.getDifficulty() == EnumDifficulty.HARD && !entityLivingIn.isChild()) && entityLivingIn instanceof EntityPig) {
			if (this.world.getDifficulty() != EnumDifficulty.HARD && this.rand.nextBoolean()) { return; }
			
			EntityZombiePig entityzombiepig = new EntityZombiePig(this.world);
			entityzombiepig.copyLocationAndAnglesFrom(entityLivingIn);
			this.world.removeEntity(entityLivingIn);
			entityzombiepig.onInitialSpawn(this.world.getDifficultyForLocation(this.getPosition()), (IEntityLivingData) null);
			
			this.world.spawnEntity(entityzombiepig);
		}
	}
	
	@Override public int getPlayerInfectionChance() { return 10; }
} public class EntityZombieSheep extends EntityMob implements IZombieInfectionMob {
	public EntityZombieSheep(World world) {
		super(world);
		this.setSize(0.9F, 1.3F);
		this.tasks.addTask(0, new EntityAISwimming(this));
		this.tasks.addTask(2, new EntityAIWander(this, 1.0D));
		this.tasks.addTask(2, new EntityAIAttackMelee(this, 1.0D, false));
		this.tasks.addTask(3, new EntityAIAttackMelee(this, 1.0D, true));
		this.tasks.addTask(3, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F));
		this.tasks.addTask(4, new EntityAILookIdle(this));
		this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, true));
		this.targetTasks.addTask(2, new EntityAINearestAttackableTarget<EntityPlayer>(this, EntityPlayer.class, true));
		this.targetTasks.addTask(2, new EntityAINearestAttackableTarget<EntitySheep>(this, EntitySheep.class, false));
	}
	
	@Override protected void applyEntityAttributes() {
		super.applyEntityAttributes();
		this.getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(10.0D);
		this.getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.3D);
	}
	
	@Override public boolean attackEntityAsMob(Entity entity) {
		boolean flag = super.attackEntityAsMob(entity);
		
		if (flag) {
			int i = this.world.getDifficulty().getDifficultyId();
			
			if (this.getHeldItemMainhand() == null && this.isBurning() && this.rand.nextFloat() < (float) i * 0.3F) {
				entity.setFire(2 * i);
			}
		}
		
		return flag;
	}
	
	@Override protected SoundEvent getAmbientSound() { return SoundEvents.ENTITY_SHEEP_AMBIENT; }
	@Override protected SoundEvent getHurtSound(DamageSource source) { return SoundEvents.ENTITY_SHEEP_HURT; }
	@Override protected SoundEvent getDeathSound() { return SoundEvents.ENTITY_SHEEP_DEATH; }
	
	@Override protected void playStepSound(BlockPos pos, Block blockIn) {
		this.playSound(SoundEvents.ENTITY_SHEEP_STEP, 0.15F, 1.0F);
	}
	
	@Override protected float getSoundVolume() { return 0.4F; }
	@Override public EnumCreatureAttribute getCreatureAttribute() { return EnumCreatureAttribute.UNDEAD; }
	@Override protected Item getDropItem() { return Items.ROTTEN_FLESH; }
	
	@Override public void onLivingUpdate() {
		if (this.world.isDaytime() && !this.world.isRemote && !this.isChild()) {
			float f = this.getBrightness();
			
			if (f > 0.5F && this.rand.nextFloat() * 30.0F < (f - 0.4F) * 2.0F && this.world.canBlockSeeSky(new BlockPos(MathHelper.floor(this.posX), MathHelper.floor(this.posY), MathHelper.floor(this.posZ)))) {
				this.setFire(8);
			}
		}
		
		super.onLivingUpdate();
	}
	
	@Override public void onKillEntity(EntityLivingBase entityLivingIn) {
		super.onKillEntity(entityLivingIn);
		
		if ((this.world.getDifficulty() == EnumDifficulty.NORMAL || this.world.getDifficulty() == EnumDifficulty.HARD && !entityLivingIn.isChild()) && entityLivingIn instanceof EntitySheep) {
			if (this.world.getDifficulty() != EnumDifficulty.HARD && this.rand.nextBoolean()) { return; }
			
			EntityZombieSheep entityzombiesheep = new EntityZombieSheep(this.world);
			entityzombiesheep.copyLocationAndAnglesFrom(entityLivingIn);
			this.world.removeEntity(entityLivingIn);
			entityzombiesheep.onInitialSpawn(this.world.getDifficultyForLocation(this.getPosition()), (IEntityLivingData) null);
			
			this.world.spawnEntity(entityzombiesheep);
		}
	}
	
	@Override public int getPlayerInfectionChance() { return 10; }
} public class InfectedPlayerTooltipEncryptEvent {
	@SubscribeEvent(priority = EventPriority.LOWEST) public void encryptTooltip(ItemTooltipEvent event) {
		if (event.getEntityPlayer() == null) return;
		if (event.getEntityPlayer().isPotionActive(ModRegistry.POTION_INFECTION)
		&& !event.getEntityPlayer().isPotionActive(ModRegistry.POTION_CURE)) {
			if (TimeInfectedTrackingClient.getSecondsInfected() > 60) {
				boolean doShuffle = true;
				if (ZombieInfectionAPI.getEncryptionExclusions().contains(event.getItemStack().getUnlocalizedName())) doShuffle = false;
				if (ZombieInfectionAPI.getEncryptionSwitches().containsKey(event.getItemStack().getUnlocalizedName())) doShuffle = false;
				if (doShuffle) {
					for (int i = 0; i < event.getToolTip().size(); i ++) {
						String s = event.getToolTip().get(i);
						ArrayList<String> chars = new ArrayList<String>();
						for (int i2 = 0; i2 < s.length(); i2 ++) {
							chars.add(s.substring(i2, i2 + 1));
						}
						Collections.shuffle(chars);
						String ns = "";
						for (String s2 : chars) {
							ns = ns + s2;
						}
						event.getToolTip().set(i, ns);
					}
					event.getToolTip().add(I18n.format("tooltip.infectedeyes"));
				}
				if (ZombieInfectionAPI.getEncryptionSwitches().containsKey(event.getItemStack().getUnlocalizedName())) {
					event.getToolTip().set(0, I18n.format(ZombieInfectionAPI.getEncryptionSwitches().get(event.getItemStack().getUnlocalizedName())));
					if (ZombieInfectionAPI.getEncryptionSwitchesTooltips().containsKey(event.getItemStack().getUnlocalizedName())) {
						for (String tT : ZombieInfectionAPI.getEncryptionSwitchesTooltips().get(event.getItemStack().getUnlocalizedName())) {
							event.getToolTip().add(I18n.format(tT));
						}
					}
				}
			}
		}
	}
} @SideOnly(Side.CLIENT) public class ModelHelper {
	public static void registerItemInternal(Item item, String[] registryNames, int[] registryMetas) {
		if (registryNames.length != registryMetas.length) {
			LogHelper.warn("Could not register models for " + item.getUnlocalizedName() + ": registryNames and registryMetas do not have matching lengths.");
			return;
		}
		ItemModelMesher mesher = Minecraft.getMinecraft().getRenderItem().getItemModelMesher();
		for (int i = 0; i < registryNames.length; i ++) {
			mesher.register(item, registryMetas[i], new ModelResourceLocation(Reference.RESOURCE_PREFIX + registryNames[i], "inventory"));
		}
	}
	
	public static void registerItem(Item item, String[] registryNames, int[] registryMetas) {
		ModelBakery.registerItemVariants(item, generateVariants(registryNames));
		registerItemInternal(item, registryNames, registryMetas);
	}
	
	public static void registerBlock(Block block, IStateMapper mapper, String[] registryNames, int[] registryMetas) {
		registerItemInternal(Item.getItemFromBlock(block), registryNames, registryMetas);
		ModelBakery.registerItemVariants(Item.getItemFromBlock(block), generateVariants(registryNames));
		Minecraft.getMinecraft().getRenderItem().getItemModelMesher().getModelManager().getBlockModelShapes().registerBlockWithStateMapper(block, mapper);
	}
	
	public static void registerBlock(Block block, String[] registryNames, int[] registryMetas) {
		registerBlock(block, null, registryNames, registryMetas);
	}
	
	public static void registerBlock(Block block, String registryName, IStateMapper mapper) {
		registerBlock(block, mapper, new String[] {registryName}, new int[] {0});
	}
	
	public static void registerBlock(Block block, String registryName) {
		registerBlock(block, null, new String[] {registryName}, new int[] {0});
	}
	
	public static void registerBlock(Block block) {
		registerBlock(block, null, new String[] {block.getUnlocalizedName().substring(5).replace(Reference.RESOURCE_PREFIX, "")}, new int[] {0});
	}
	
	public static void registerItem(Item item, String registryName) {
		registerItemInternal(item, new String[] {registryName}, new int[] {0});
	}
	
	public static void registerItem(Item item, int[] registryMetas) {
		String[] registryNames = new String[registryMetas.length];
		for (int i = 0; i < registryNames.length; i ++) {
			registryNames[i] = item.getUnlocalizedName().substring(5).replace(Reference.RESOURCE_PREFIX, "");
		}
		ModelBakery.registerItemVariants(item, generateVariants(registryNames));
		registerItemInternal(item, registryNames, registryMetas);
	}
	
	public static void registerItem(Item item) {
		registerItemInternal(item, new String[] {item.getUnlocalizedName().substring(5).replace(Reference.RESOURCE_PREFIX, "")}, new int[] {0});
	}
	
	public static void removeBlockState(Block block) {
		Minecraft.getMinecraft().getRenderItem().getItemModelMesher().getModelManager().getBlockModelShapes().registerBuiltInBlocks(block);
	}
	
	static ResourceLocation[] generateVariants(String[] registryNames) {
		ArrayList<ResourceLocation> ret = new ArrayList<ResourceLocation>();
		for (String aString : registryNames) {
			ret.add(new ResourceLocation(Reference.MOD_ID, aString.contains(Reference.RESOURCE_PREFIX) ? aString.replace(Reference.RESOURCE_PREFIX, "") : aString));
		}
		return ret.toArray(new ResourceLocation[] {});
	}
} @Mod.EventBusSubscriber()
public class ModRegistry {
	public static final ItemBase CURE = new ItemCure();
	public static final ItemBase INFECTED_EGG = new ItemInfectedEgg();
	public static final ItemBase INFECTED_MILK = new ItemInfectedMilk();
	public static final ItemBase KNOWLEDGE_BOOK = new ItemKnowledgeBook();
	public static final ItemBase NEEDLE = new ItemNeedle();
	
	public static final PotionZI POTION_INFECTION = new PotionZI(new ResourceLocation(Reference.MOD_ID, "infection"), new ResourceLocation(Reference.MOD_ID, "potion/infection.png"), false, 0xff00ff);
	public static final PotionZI POTION_CURE = new PotionZI(new ResourceLocation(Reference.MOD_ID, "cure"), new ResourceLocation(Reference.MOD_ID, "potion/cure.png"), false, 0xff00ff);
	
	@SubscribeEvent public static void registerItems(RegistryEvent.Register<Item> event) {
		IForgeRegistry<Item> registry = event.getRegistry();
		
		registry.register(CURE);
		registry.register(INFECTED_EGG);
		registry.register(INFECTED_MILK);
		registry.register(KNOWLEDGE_BOOK);
		registry.register(NEEDLE);
	}
	
	@SubscribeEvent public static void registerPotions(RegistryEvent.Register<Potion> event) {
		IForgeRegistry<Potion> registry = event.getRegistry();
		
		registry.register(POTION_INFECTION);
		registry.register(POTION_CURE);
	}
}
import net.minecraft.client.Minecraft;
import net.minecraft.client.model.ModelChicken;
import net.minecraft.client.model.ModelCow;
import net.minecraft.client.model.ModelPig;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.world.World;
import net.minecraftforge.client.event.ModelRegistryEvent;
import net.minecraftforge.client.model.ModelLoader;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.fml.client.registry.RenderingRegistry;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.relauncher.Side;
import com.zalthonethree.zombieinfection.Reference;
import com.zalthonethree.zombieinfection.Reference.IdTracking;
import com.zalthonethree.zombieinfection.client.gui.GuiEyeInfection;
import com.zalthonethree.zombieinfection.client.gui.KnowledgeBook;
import com.zalthonethree.zombieinfection.client.model.ModelZombieSheep;
import com.zalthonethree.zombieinfection.client.render.RenderZombieChicken;
import com.zalthonethree.zombieinfection.client.render.RenderZombieCow;
import com.zalthonethree.zombieinfection.client.render.RenderZombiePig;
import com.zalthonethree.zombieinfection.client.render.RenderZombieSheep;
import com.zalthonethree.zombieinfection.entity.EntityZombieChicken;
import com.zalthonethree.zombieinfection.entity.EntityZombieCow;
import com.zalthonethree.zombieinfection.entity.EntityZombiePig;
import com.zalthonethree.zombieinfection.entity.EntityZombieSheep;
import com.zalthonethree.zombieinfection.event.InfectedPlayerTooltipEncryptEvent;
import com.zalthonethree.zombieinfection.handler.ModelHelper;
import com.zalthonethree.zombieinfection.init.ModRegistry;
package com.zalthonethree.zombieinfection.proxy;



@Mod.EventBusSubscriber(Side.CLIENT) public class ClientProxy extends ServerProxy {
	@Override public void init() {
		super.init();
		MinecraftForge.EVENT_BUS.register(new GuiEyeInfection(Minecraft.getMinecraft()));