Package org.spoutcraft.api.gui

Examples of org.spoutcraft.api.gui.MinecraftTessellator


      return false;
    }

    setBrightness(1F);

    MinecraftTessellator tessellator = Spoutcraft.getTessellator();

    int internalLightLevel = 0;
    if (block == null) {
      internalLightLevel = 0x00F000F0;
    } else {
      internalLightLevel = world.getMixedBrightnessAt(block, x, y, z);
    }

    for (int i = 0; i < getX().length; i++) {
      MutableIntegerVector sourceBlock = getLightSource(i, x, y, z);

      int sideBrightness;

      if (block != null && sourceBlock != null) {
        sideBrightness = world.getMixedBrightnessAt(block, sourceBlock.getBlockX(), sourceBlock.getBlockY(), sourceBlock.getBlockZ());
      } else {
        sideBrightness = internalLightLevel;
      }

      if (block == null) {
        if (i == 5) {
          tessellator.setNormal(0, 1, 0);
        } else if (i == 3) {
          tessellator.setNormal(0, 0, 1);
        } else if (i == 2) {
          tessellator.setNormal(1, 0, 0);
        }
      }

      tessellator.setBrightness(sideBrightness);

      tessellator.setColorOpaqueFloat(1.0F, 1.0F, 1.0F);

      float[] xx = getX()[i];
      float[] yy = getY()[i];
      float[] zz = getZ()[i];
      float[] tx = getTextureXPos()[i];
      float[] ty = getTextureYPos()[i];

      for (int j = 0; j < 4; j++) {
        tessellator.addVertexWithUV(x + xx[j], y + yy[j], z + zz[j], tx[j], ty[j]);
      }
    }
    return true;
  }
View Full Code Here


            int x = chunkX * 16;
            int y = chunkZ * 16;
            int width = x + 16 * levelOfDetail;
            int height = y + 16 * levelOfDetail;
            map.loadColorImage();
            MinecraftTessellator tessellator = Spoutcraft.getTessellator();
            tessellator.startDrawingQuads();
            tessellator.addVertexWithUV((double) width, (double) height, -90, 1, 1);
            tessellator.addVertexWithUV((double) width, (double) y, -90, 1, 0);
            tessellator.addVertexWithUV((double) x, (double) y, -90, 0, 0);
            tessellator.addVertexWithUV((double) x, (double) height, -90, 0, 1);
            tessellator.draw();
  //          GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
  //          RenderUtil.drawRectangle(x, y, width, height, 0x88ffffff);
            if (MinimapConfig.getInstance().isHeightmap()) {
              GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_DST_COLOR);
              map.loadHeightImage();
              tessellator.startDrawingQuads();
              tessellator.addVertexWithUV((double) width, (double) height, -90, 1, 1);
              tessellator.addVertexWithUV((double) width, (double) y, -90, 1, 0);
              tessellator.addVertexWithUV((double) x, (double) y, -90, 0, 0);
              tessellator.addVertexWithUV((double) x, (double) height, -90, 0, 1);
              tessellator.draw();
            }
            GL11.glPopMatrix();
          }
        }
      }
View Full Code Here

TOP

Related Classes of org.spoutcraft.api.gui.MinecraftTessellator

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.