Package org.spoutcraft.client.block

Examples of org.spoutcraft.client.block.SpoutcraftChunk


  // Don't call this method, for future use.
  protected Texture getTextureFromCoords(World world, int x, int y, int z) {
    short customId = 0;
    Texture texture = null;
    if (SpoutClient.getInstance().getRawWorld() != null) {
      SpoutcraftChunk sChunk = Spoutcraft.getChunkAt(SpoutClient.getInstance().getRawWorld(), x, y, z);
      customId = sChunk.getCustomBlockId(x, y, z)
      short[] customBlockIds = sChunk.getCustomBlockIds();
      byte[] customBlockData = sChunk.getCustomBlockData();     

      if (customId > 0) {
        CustomBlock block = MaterialData.getCustomBlock(customId);
        if (block != null) {
          BlockDesign design = block.getBlockDesign(customBlockData[customId]);
View Full Code Here


        List<String> hitTextures = new ArrayList<String>();
        List<String> hitTexturesPlugins = new ArrayList<String>();
        hitTextures.add("/terrain.png");
        hitTexturesPlugins.add("");

        SpoutcraftChunk sChunk = Spoutcraft.getChunkAt(worldObj, posX, posY, posZ);
        short[] customBlockIds = sChunk.getCustomBlockIds();
        byte[] customBlockData = sChunk.getCustomBlockData();
        blockRenderer.customIds = customBlockIds;

        for (int renderPass = 0; renderPass < limit; ++renderPass) {
          boolean skipRenderPass = false;
          boolean rendered = false;
View Full Code Here

  public void renderTileEntityChestAt(TileEntityChest par1TileEntityChest, double par2, double par4, double par6, float par8) {
    int var9;
    // Spout Start
    short customId = 0;   
    if (SpoutClient.getInstance().getRawWorld() != null && par1TileEntityChest.hasWorldObj()) {
      SpoutcraftChunk sChunk = Spoutcraft.getChunkAt(par1TileEntityChest.worldObj, par1TileEntityChest.xCoord, par1TileEntityChest.yCoord, par1TileEntityChest.zCoord);
      customId = sChunk.getCustomBlockId(par1TileEntityChest.xCoord, par1TileEntityChest.yCoord, par1TileEntityChest.zCoord)
      short[] customBlockIds = sChunk.getCustomBlockIds();
      byte[] customBlockData = sChunk.getCustomBlockData();     

      if (customId > 0) {       
        return; // Don't render the chest image or animation if its a custom chest.
      }
    }
View Full Code Here

      Block var6 = Block.blocksList[par4];
      // Spout Start
      Texture texture = null;     
      short customId = 0;
      if (SpoutClient.getInstance().getRawWorld() != null) {
        SpoutcraftChunk sChunk = Spoutcraft.getChunkAt(SpoutClient.getInstance().getRawWorld(), par1, par2, par3);
        customId = sChunk.getCustomBlockId(par1, par2, par3);
        short[] customBlockIds = sChunk.getCustomBlockIds();
        byte[] customBlockData = sChunk.getCustomBlockData();
        if (customId > 0) {
          if (Configuration.displayCustomParticles) {
            CustomBlock block = MaterialData.getCustomBlock(customId);
            if (block != null) {
              BlockDesign design = block.getBlockDesign(customBlockData[customId]);
View Full Code Here

      // Spout Start
      Texture texture = null;

      short customId = 0;
      if (SpoutClient.getInstance().getRawWorld() != null) {
        SpoutcraftChunk sChunk = Spoutcraft.getChunkAt(SpoutClient.getInstance().getRawWorld(), par1, par2, par3);
        customId = sChunk.getCustomBlockId(par1, par2, par3);
        short[] customBlockIds = sChunk.getCustomBlockIds();
        byte[] customBlockData = sChunk.getCustomBlockData();

        if (customId > 0) {
          if (Configuration.displayCustomParticles) {
            CustomBlock block = MaterialData.getCustomBlock(customId);
            if (block != null) {
View Full Code Here

    int light = Block.lightValue[par5];

    // Fix for generation-time accessing
    short customId = 0;
    if (SpoutClient.getInstance().getRawWorld() != null) {
      SpoutcraftChunk chunk = Spoutcraft.getChunkAt(SpoutClient.getInstance().getRawWorld(), par2, par3, par4);
      customId = chunk.getCustomBlockId(par2, par3, par4);     
    }
    if (customId > 0) {
      CustomBlock block = MaterialData.getCustomBlock(customId);
      if (block != null) {
        light = block.getLightLevel();
View Full Code Here

      FixedLocation target = Spoutcraft.getActivePlayer().getLastClickedLocation();
      if (target != null) {
        int x = (int) target.getX();
        int y = (int) target.getY();
        int z = (int) target.getZ();
        SpoutcraftChunk chunk = Spoutcraft.getChunkAt(entityhuman.worldObj, x, y, z);
        short customId = chunk.getCustomBlockId(x, y, z);
        if (customId > 0) {
          CustomBlock b = MaterialData.getCustomBlock(customId);
          if (b == null) {
            // ToDo: Shouldn't be needed.  Something outside of SpoutPlugin changed the Custom Blocks value outside of SpoutPlugin.  This is a fall-back return to prevent client returning null and crashing.
            return (!entityhuman.canHarvestBlock(this) ? entityhuman.getCurrentPlayerStrVsBlock(this, false) / 1.0F / 100.0F : entityhuman.getCurrentPlayerStrVsBlock(this, true) / 1.0F / 30.0F);
View Full Code Here

    output.write(data);
  }

  public void run(int playerId) {
    ByteBuffer result = ByteBuffer.allocate(data.length).put(data);
    SpoutcraftChunk chunk = Spoutcraft.getChunk(SpoutClient.getInstance().getRawWorld(), chunkX, chunkZ);
    for (int i = 0; i < data.length / 7; i++) {
      int index = i * 7;
      int x = result.get(index) + chunkX * 16;
      int y = result.getShort(index+1);
      int z = result.get(index+3) + chunkZ * 16;
      short id = result.getShort(index+4);
      byte data = result.get(index+6);
      chunk.setCustomBlockId(x, y, z, id);
      chunk.setCustomBlockData(x, y, z, data);
      SpoutClient.getInstance().getRawWorld().updateAllLightTypes(x, y, z);
    }
  }
View Full Code Here

      }
     
      // Spout Start
      short customId = 0;   
      if (SpoutClient.getInstance().getRawWorld() != null && this.hasWorldObj()) {
        SpoutcraftChunk sChunk = Spoutcraft.getChunkAt(this.worldObj, this.xCoord, this.yCoord, this.zCoord);
        customId = sChunk.getCustomBlockId(this.xCoord, this.yCoord, this.zCoord)
        short[] customBlockIds = sChunk.getCustomBlockIds();
        byte[] customBlockData = sChunk.getCustomBlockData();     

        if (customId > 0) {       
          // Custom Chest Code to be here.   
        } else {
          this.worldObj.playSoundEffect(var8, (double)this.yCoord + 0.5D, var11, "random.chestopen", 0.5F, this.worldObj.rand.nextFloat() * 0.1F + 0.9F);
        }
      }
      // Spout End
    }

    if (this.numUsingPlayers == 0 && this.lidAngle > 0.0F || this.numUsingPlayers > 0 && this.lidAngle < 1.0F) {
      float var9 = this.lidAngle;

      if (this.numUsingPlayers > 0) {
        this.lidAngle += var1;
      } else {
        this.lidAngle -= var1;
      }

      if (this.lidAngle > 1.0F) {
        this.lidAngle = 1.0F;
      }

      float var10 = 0.5F;

      if (this.lidAngle < var10 && var9 >= var10 && this.adjacentChestZNeg == null && this.adjacentChestXNeg == null) {
        var11 = (double)this.xCoord + 0.5D;
        double var6 = (double)this.zCoord + 0.5D;

        if (this.adjacentChestZPosition != null) {
          var6 += 0.5D;
        }

        if (this.adjacentChestXPos != null) {
          var11 += 0.5D;
        }
       
        // Spout Start
        short customId = 0;   
        if (SpoutClient.getInstance().getRawWorld() != null && this.hasWorldObj()) {
          SpoutcraftChunk sChunk = Spoutcraft.getChunkAt(this.worldObj, this.xCoord, this.yCoord, this.zCoord);
          customId = sChunk.getCustomBlockId(this.xCoord, this.yCoord, this.zCoord)
          short[] customBlockIds = sChunk.getCustomBlockIds();
          byte[] customBlockData = sChunk.getCustomBlockData();     

          if (customId > 0) {       
            // Custom Chest Sound to be here.
          } else {
            this.worldObj.playSoundEffect(var11, (double)this.yCoord + 0.5D, var6, "random.chestclosed", 0.5F, this.worldObj.rand.nextFloat() * 0.1F + 0.9F);
View Full Code Here

    Arrays.fill(this.precipitationHeightMap, -999);
    Arrays.fill(this.blockBiomeArray, (byte) - 1);

    // Spout Start
    spoutChunk = new SpoutcraftChunk(this);
    // Spout End
  }
View Full Code Here

TOP

Related Classes of org.spoutcraft.client.block.SpoutcraftChunk

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.