@Override public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) { if (modelID != this.getRenderId()) { return; } GL11.glPushMatrix(); float scale = 0.0625f / 4.0f; GL11.glScalef(scale, scale, scale); // GL11.glRotatef(90, 1, 0, 0); GL11.glRotatef(90, 0, -1, 0); this.bind(windmillTextures); ((ModelWindmill) modelWindmill).renderinOut(null, 0, 0, 0, 0, 0, 1.0f); GL11.glRotatef( -(FMLClientHandler.instance().getClient().getMinecraft().getSystemTime() / 50) % 360, 0, 0, 1); modelWindmill.render(null, 0, 0, 0, 0, 0, 1.0f); GL11.glPopMatrix(); this.bind(MC_BLOCK_SHEET); }
@Override public void renderTileEntityAt(TileEntity tileentity, double x, double y, double z, float f) { TileEntityWindmill tile = (TileEntityWindmill) tileentity; // System.out.println("renderTileEntityAt"); GL11.glPushMatrix(); GL11.glTranslatef((float) x + 0.5F, (float) y + 0.5F, (float) z + 0.5F); float scale = 0.0625f; // float scale = 0.125f; GL11.glScalef(scale, scale, scale); switch (tile.direction) { case UP: GL11.glRotatef(90, 1, 0, 0); break; case DOWN: GL11.glRotatef(90, -1, 0, 0); break; case WEST: GL11.glRotatef(90, 0, 1, 0); break; case EAST: GL11.glRotatef(90, 0, -1, 0); break; case SOUTH: GL11.glRotatef(180, 0, 1, 0); break; default: break; } this.bindTexture(windmillTextures); ((ModelWindmill) modelWindmill).renderinOut(null, 0, 0, 0, 0, 0, 1.0f); // 傾きのスピード GL11.glRotatef(tile.getRotateStep(), 0, 0, 1); modelWindmill.render(null, 0, 0, 0, 0, 0, 1.0f); GL11.glPopMatrix(); }