@Override public AxisAlignedBB getSelectedBoundingBoxFromPool( World par1World, int par2, int par3, int par4) { int i = par1World.getBlockMetadata(par2, par3, par4); float f = 0.375F; setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, f, 1.0F); if (i == 0) { setBlockBounds(0.0F, 1.0F - f, 0.0F, 1.0F, 1.0F, 1.0F); } if (i == 1) { setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, f, 1.0F); } if (i == 2) { setBlockBounds(0.0F, 0.0F, 1.0F - f, 1.0F, 1.0F, 1.0F); } if (i == 3) { setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, f); } if (i == 4) { setBlockBounds(1.0F - f, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); } if (i == 5) { setBlockBounds(0.0F, 0.0F, 0.0F, f, 1.0F, 1.0F); } AxisAlignedBB box = AxisAlignedBB.getAABBPool() .getAABB( par2 + this.minX, par3 + this.minY, par4 + this.minZ, par2 + this.maxX, par3 + this.maxY, par4 + this.maxZ); setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 0.375F); return box; }
/** * Allows the entity to update its state. Overridden in most subclasses, e.g. the mob spawner uses * this to count ticks and creates a new spawn inside its implementation. */ public void updateEntity() { if (!anyPlayerInRange()) { return; } if (worldObj.isRemote) { double d = (float) xCoord + worldObj.rand.nextFloat(); double d1 = (float) yCoord + worldObj.rand.nextFloat(); double d3 = (float) zCoord + worldObj.rand.nextFloat(); worldObj.spawnParticle("smoke", d, d1, d3, 0.0D, 0.0D, 0.0D); worldObj.spawnParticle("flame", d, d1, d3, 0.0D, 0.0D, 0.0D); yaw2 = yaw % 360D; yaw += 4.5454545021057129D; } else { if (delay == -1) { updateDelay(); } if (delay > 0) { delay--; return; } for (int i = 0; i < field_70395_h; i++) { Entity entity = EntityList.createEntityByName(mobID, worldObj); if (entity == null) { return; } int j = worldObj .getEntitiesWithinAABB( entity.getClass(), AxisAlignedBB.getAABBPool() .addOrModifyAABBInPool( xCoord, yCoord, zCoord, xCoord + 1, yCoord + 1, zCoord + 1) .expand(8D, 4D, 8D)) .size(); if (j >= 6) { updateDelay(); return; } if (entity == null) { continue; } double d2 = (double) xCoord + (worldObj.rand.nextDouble() - worldObj.rand.nextDouble()) * 4D; double d4 = (yCoord + worldObj.rand.nextInt(3)) - 1; double d5 = (double) zCoord + (worldObj.rand.nextDouble() - worldObj.rand.nextDouble()) * 4D; EntityLiving entityliving = (entity instanceof EntityLiving) ? (EntityLiving) entity : null; entity.setLocationAndAngles(d2, d4, d5, worldObj.rand.nextFloat() * 360F, 0.0F); if (entityliving != null && !entityliving.getCanSpawnHere()) { continue; } func_70383_a(entity); worldObj.spawnEntityInWorld(entity); worldObj.playAuxSFX(2004, xCoord, yCoord, zCoord, 0); if (entityliving != null) { entityliving.spawnExplosionParticle(); } updateDelay(); } } super.updateEntity(); }