Package org.spoutcraft.api.material

Examples of org.spoutcraft.api.material.CustomBlock


        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);
          }
          return b.getHardness() < 0.0F ? 0.0F : (!entityhuman.canHarvestBlock(this) ? entityhuman.getCurrentPlayerStrVsBlock(this, false) / b.getHardness() / 100.0F : entityhuman.getCurrentPlayerStrVsBlock(this, true) / b.getHardness() / 30.0F);
        }
      }
    }
    return this.blockHardness < 0.0F ? 0.0F : (!entityhuman.canHarvestBlock(this) ? entityhuman.getCurrentPlayerStrVsBlock(this, false) / this.blockHardness / 100.0F : entityhuman.getCurrentPlayerStrVsBlock(this, true) / this.blockHardness / 30.0F);
  }
View Full Code Here


      try {
        LightingData data = queue.take();
        World world = SpoutClient.getHandle().theWorld;
        if (world != null && world.chunkProvider.chunkExists(data.cx, data.cz)) {
          for (int i = 0; i < data.ids.length; i++) {
            CustomBlock cb = MaterialData.getCustomBlock(data.ids[i]);
            if (cb != null && cb.getLightLevel() != 0) {
              int bx = (i >> 12) & 0xF;
              int by = i & 0xFF;
              int bz = (i >> 8) & 0xF;
              world.updateLightByType(lightingBlockList, EnumSkyBlock.Sky, data.cx * 16 + bx, by, data.cz * 16 + bz);
              world.updateLightByType(lightingBlockList, EnumSkyBlock.Block, data.cx * 16 + bx, by, data.cz * 16 + bz);
View Full Code Here

          int x = MathHelper.floor_double(this.posX);
          int y = MathHelper.floor_double(this.boundingBox.minY) - 1;
          int z = MathHelper.floor_double(this.posZ);
          short customId = Spoutcraft.getChunkAt(worldObj, x, y, z).getCustomBlockId(x, y, z);
          if (customId > 0) {
            CustomBlock block = MaterialData.getCustomBlock(customId);
            if (block != null) {
              var13 = block.getFriction() * 0.98F;
            }
          }
        }
        // Spout End
      }
View Full Code Here

  public void writeData(SpoutOutputStream output) throws IOException {
    output.writeShort(customId);
  }

  public void run(int id) {
    CustomBlock block = MaterialData.getCustomBlock(customId);
    if (block != null) {
      block.setBlockDesign(design, data);
    }
  }
View Full Code Here

          int y = MathHelper.floor_double(this.boundingBox.minY) - 1;
          int z = MathHelper.floor_double(this.posZ);
          org.spoutcraft.client.block.SpoutcraftChunk chunk = org.spoutcraft.api.Spoutcraft.getChunkAt(worldObj, x, y, z);
          short customId = chunk.getCustomBlockId(x, y, z);
          if (customId > 0) {
            CustomBlock block = MaterialData.getCustomBlock(customId);
            if (block != null) {
              var3 = block.getFriction() * 0.98F;
            }
          }
          // Spout End
        }
      }
View Full Code Here

TOP

Related Classes of org.spoutcraft.api.material.CustomBlock

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.