@Override public ModelRenderer addBox(String partName, float offX, float offY, float offZ, int width, int height, int depth) { partName = this.boxName + "." + partName; TextureOffset textureoffset = this.model.getTextureOffset(partName); this.setTextureOffset(textureoffset.textureOffsetX, textureoffset.textureOffsetY); this.cubeList.add((new ModelBox(this, this.textureOffsetX, this.textureOffsetY, offX, offY, offZ, width, height, depth, 0.0F)).setBoxName(partName)); return this; }
private void compileDisplayList(float scale) { VertexBuffer vb = Tessellator.getInstance().getBuffer(); displayList = GLAllocation.generateDisplayLists(1); glNewList(displayList, GL_COMPILE); cubeList.forEach(cube -> cube.render(vb, scale)); glEndList(); compiled = true; }
/** * Creates a textured box. */ @Override public void addBox(float offX, float offY, float offZ, int width, int height, int depth, float scaleFactor) { this.cubeList.add(new ModelBox(this, this.textureOffsetX, this.textureOffsetY, offX, offY, offZ, width, height, depth, scaleFactor)); }
private void compileDisplayList(float scale) { this.displayList = GLAllocation.generateDisplayLists(1); GlStateManager.glNewList(this.displayList, 4864); VertexBuffer buffer = Tessellator.getInstance().getBuffer(); for (ModelBox box : this.cubeList) { box.render(buffer, scale); } GlStateManager.glEndList(); this.compiled = true; }
@Override public ModelRenderer addBox(float offX, float offY, float offZ, int width, int height, int depth) { this.cubeList.add(new ModelBox(this, this.textureOffsetX, this.textureOffsetY, offX, offY, offZ, width, height, depth, 0.0F)); return this; }
private void compileDisplayList(float scale) { this.displayList = GLAllocation.generateDisplayLists(1); GlStateManager.glNewList(this.displayList, 4864); BufferBuilder buffer = Tessellator.getInstance().getBuffer(); for (ModelBox box : this.cubeList) { box.render(buffer, scale); } GlStateManager.glEndList(); this.compiled = true; } }
@Override public ModelRenderer addBox(float offX, float offY, float offZ, int width, int height, int depth, boolean mirrored) { this.cubeList.add(new ModelBox(this, this.textureOffsetX, this.textureOffsetY, offX, offY, offZ, width, height, depth, 0.0F, mirrored)); return this; }