@Override protected @Nonnull BoundingBox getChargingStrength(@Nonnull IBlockState state, @Nonnull BlockPos pos) { return new BoundingBox(pos).expand(ChargerConfig.wirelessRange.get()); }
protected @Nonnull BoundingBox getChargingStrength(@Nonnull IBlockState state, @Nonnull BlockPos pos) { return new BoundingBox(pos).expand(ChargerConfig.wirelessRangeAntenna.get()); }
@Override protected @Nonnull BoundingBox getBounds() { return new BoundingBox(getPos()).expand(4, 1d, 4); } });
public CrookHarvestingTarget(@Nonnull BlockPos pos) { this.bb = new BoundingBox(pos, pos.up(30)).expand(12, 0, 12); }
public AxeHarvestingTarget(@Nonnull IBlockState wood, @Nonnull BlockPos pos) { this.wood = wood; variant = getVariant(wood); this.bb = new BoundingBox(pos, pos.up(30)).expand(12, 0, 12); }
protected void addTransmissionQuads(@Nonnull IConduitTexture tex, Vector4f color, @Nonnull BlockRenderLayer layer, @Nonnull IConduit conduit, @Nonnull CollidableComponent component, float selfIllum, @Nonnull List<BakedQuad> quads) { if (layer != getTransmissionQuadsLayer()) { return; } float shrink = 1 / 32f; final EnumFacing componentDirection = component.getDirection(); float xLen = Math.abs(componentDirection.getFrontOffsetX()) == 1 ? 0 : shrink; float yLen = Math.abs(componentDirection.getFrontOffsetY()) == 1 ? 0 : shrink; float zLen = Math.abs(componentDirection.getFrontOffsetZ()) == 1 ? 0 : shrink; BoundingBox cube = component.bound; BoundingBox bb = cube.expand(-xLen, -yLen, -zLen); addQuadsForSection(bb, tex, componentDirection, quads, color); }
@Override public @Nonnull BoundingBox getBounds() { return new BoundingBox(getPos()).expand(getRange() / 2d); }
@Override @Nonnull public BoundingBox getBounds() { return new BoundingBox(getPos()).expand(getRange() + (range == 0 ? 1 / 32f : 0)); }
@Override public @Nonnull BoundingBox getBounds() { return new BoundingBox(getPos()).expand(getRange() + (range == 0 ? 1 / 32f : 0)); }
@Override public @Nonnull BoundingBox getBounds() { return new BoundingBox(getPos()).expand(getRange(), 0, getRange()); }
default @Nonnull BoundingBox getBounds() { return new BoundingBox(getSpawnerPos()).expand(getRange(), 1d, getRange()); }
public FarmHarvestingTarget(@Nonnull TreeFarmer farmer, @Nonnull IFarmer farm) { this.farmer = farmer; this.bb = new BoundingBox(farm.getLocation(), farm.getLocation().up(30)).expand(farm.getFarmSize() + 7, 0, farm.getFarmSize() + 7); }
private boolean isAreaClear(World world, Entity entity, int spawnRangeXZ, int spawnRangeY, int amount) { if (SpawnerConfig.poweredSpawnerMaxNearbyEntities.get() > 0) { int nearbyEntities = world .getEntitiesWithinAABB(entity.getClass(), spawner.getBounds().expand(spawnRangeXZ, spawnRangeY, spawnRangeXZ), EntitySelectors.IS_ALIVE).size(); if (nearbyEntities >= amount) { cleanupUnspawnedEntity(entity); spawner.setNotification(SpawnerNotification.AREA_FULL); return false; } spawner.removeNotification(SpawnerNotification.AREA_FULL); } return true; }
protected void addConduitQuads(@Nonnull IConduitBundle bundle, @Nonnull IClientConduit conduit, @Nonnull IConduitTexture tex, @Nonnull CollidableComponent component, float selfIllum, BlockRenderLayer layer, @Nonnull List<BakedQuad> quads) { if (component.isDirectional()) { if (layer != getConduitQuadsLayer()) { return; // TODO? null is the blockbreaking animation } if (component.data != null) { return; // this is handled by ConduitInOutRenderer.addColorBand() or the conduits themselves } float shrink = 1 / 32f; final EnumFacing componentDirection = component.getDirection(); float xLen = Math.abs(componentDirection.getFrontOffsetX()) == 1 ? 0 : shrink; float yLen = Math.abs(componentDirection.getFrontOffsetY()) == 1 ? 0 : shrink; float zLen = Math.abs(componentDirection.getFrontOffsetZ()) == 1 ? 0 : shrink; BoundingBox cube = component.bound; BoundingBox bb = cube.expand(-xLen, -yLen, -zLen); addQuadsForSection(bb, tex, componentDirection, quads, conduit.renderError() ? COLOR_ERROR : null); if (conduit.getConnectionMode(componentDirection) == ConnectionMode.DISABLED) { TextureAtlasSprite tex2 = ConduitBundleRenderManager.instance.getConnectorIcon(component.data); BakedQuadBuilder.addBakedQuadForFace(quads, bb, tex2, componentDirection); } } else { BakedQuadBuilder.addBakedQuads(quads, component.bound, tex.getSprite()); } }
@Override protected void renderTransmissionDynamic(@Nonnull IConduit conduit, @Nonnull IConduitTexture tex, @Nullable Vector4f color, @Nonnull CollidableComponent component, float selfIllum) { final float filledRatio = ((LiquidConduit) conduit).getTank().getFilledRatio(); if (filledRatio <= 0) { return; } if (component.isDirectional()) { TextureAtlasSprite sprite = tex.getSprite(); BoundingBox[] cubes = toCubes(component.bound); for (BoundingBox cube : cubes) { if (cube != null) { float shrink = 1 / 128f; final EnumFacing componentDirection = component.getDirection(); float xLen = Math.abs(componentDirection.getFrontOffsetX()) == 1 ? 0 : shrink; float yLen = Math.abs(componentDirection.getFrontOffsetY()) == 1 ? 0 : shrink; float zLen = Math.abs(componentDirection.getFrontOffsetZ()) == 1 ? 0 : shrink; BoundingBox bb = cube.expand(-xLen, -yLen, -zLen); // TODO: This leaves holes between conduits as it only render 4 sides instead of the needed 5-6 sides drawDynamicSection(bb, sprite.getInterpolatedU(tex.getUv().x * 16), sprite.getInterpolatedU(tex.getUv().z * 16), sprite.getInterpolatedV(tex.getUv().y * 16), sprite.getInterpolatedV(tex.getUv().w * 16), color, componentDirection, true); } } } else { // TODO: HL: I commented this out because component.getDirection() (the second to last parameter) is always null in // this else branch and drawDynamicSection() with isTransmission=true (last parameter) would NPE on it. (Not a // mistake in the component.dir encapsulation, this was that way before.) // drawDynamicSection(component.bound, tex.getMinU(), tex.getMaxU(), tex.getMinV(), tex.getMaxV(), color, component.getDir(), true); } }
BoundingBox bb = cube.expand(-xLen, -yLen, -zLen);
@Override public void renderParticle(@Nonnull BufferBuilder worldRendererIn, @Nonnull Entity entityIn, float partialTicks, float rotationX, float rotationZ, float rotationYZ, float rotationXY, float rotationXZ) { GlStateManager.pushMatrix(); GlStateManager.enableLighting(); GlStateManager.disableLighting(); GlStateManager.disableCull(); GlStateManager.enableBlend(); GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 240, 240); RenderUtil.bindBlockTexture(); GlStateManager.depthMask(false); float scale = Math.min((age + partialTicks) / INIT_TIME, 1); // Vanilla bug? Particle.interpPosX/Y/Z variables are always one frame behind double x = entityIn.lastTickPosX + (entityIn.posX - entityIn.lastTickPosX) * partialTicks; double y = entityIn.lastTickPosY + (entityIn.posY - entityIn.lastTickPosY) * partialTicks; double z = entityIn.lastTickPosZ + (entityIn.posZ - entityIn.lastTickPosZ) * partialTicks; GlStateManager.translate(-x, -y, -z); GlStateManager.color(color.x, color.y, color.z, color.w); RenderUtil.renderBoundingBox(scale(owner.getPos(), getBounds(), scale).expand(0.01, 0.01, 0.01), IconUtil.instance.whiteTexture); GlStateManager.depthMask(true); GlStateManager.disableBlend(); GlStateManager.enableCull(); GlStateManager.enableLighting(); GlStateManager.popMatrix(); }
@Override public void renderParticle(@Nonnull BufferBuilder worldRendererIn, @Nonnull Entity entityIn, float partialTicks, float rotationX, float rotationZ, float rotationYZ, float rotationXY, float rotationXZ) { if (!isAlive()) { return; } GlStateManager.pushMatrix(); GlStateManager.enableLighting(); GlStateManager.disableLighting(); GlStateManager.disableCull(); GlStateManager.enableBlend(); GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 240, 240); RenderUtil.bindBlockTexture(); GlStateManager.depthMask(false); GlStateManager.translate(-interpPosX, -interpPosY, -interpPosZ); float fade = tolive / (float) maxage; GlStateManager.color(color.x, color.y, color.z, color.w * fade); RenderUtil.renderBoundingBox(new BoundingBox(pos).expand(0.01, 0.01, 0.01), IconUtil.instance.whiteTexture); GlStateManager.depthMask(true); GlStateManager.disableBlend(); GlStateManager.enableCull(); GlStateManager.enableLighting(); GlStateManager.popMatrix(); }