Examples of CustomBlock


Examples of org.spoutcraft.api.material.CustomBlock

                  int id = chunkCache.getBlockId(dx, dy, dz);
                  if (id > 0) {
                    String customTexture = null;
                    String customTextureAddon = null;
                    GenericBlockDesign design = null;
                    CustomBlock mat = null;

                    if (customBlockIds != null) {
                      int key = ((dx & 0xF) << 12) | ((dz & 0xF) << 8) | (dy & 0xFF);
                      if (customBlockIds[key] != 0) {
                        mat = MaterialData.getCustomBlock(customBlockIds[key]);
                        if (mat != null) {
                          design = (GenericBlockDesign) mat.getBlockDesign(customBlockData == null ? 0 : customBlockData[key]);
                        }
                      }
                    }

                    if (design != null) {
View Full Code Here

Examples of org.spoutcraft.api.material.CustomBlock

        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]);
              if (design != null) {
                texture = CustomTextureManager.getTextureFromUrl(block.getAddon(), design.getTextureURL());
              }
            }
          } else {
            return;
          }
View Full Code Here

Examples of org.spoutcraft.api.material.CustomBlock

        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]);
              if (design != null) {
                texture = CustomTextureManager.getTextureFromUrl(block.getAddon(), design.getTextureURL());
              }
            }
          } else {
            return;
          }
View Full Code Here

Examples of org.spoutcraft.api.material.CustomBlock

          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) {
              var2 = block.getFriction() * 0.98F;
            }
          }
        }
        // Spout End
      }
View Full Code Here

Examples of org.spoutcraft.api.material.CustomBlock

    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();
      }
    }
    int var7 = light;
    // Spout End
    int var8 = this.getSavedLightValue(EnumSkyBlock.Block, par2 - 1, par3, par4) - par6;
View Full Code Here

Examples of org.spoutcraft.api.material.CustomBlock

      int light = lightValue[par1IBlockAccess.getBlockId(x, y, z)];
      if (customIds != null) {
        int key = ((x & 0xF) << 12) | ((z & 0xF) << 8) | (y & 256);
        short customId = customIds[key];
        if (customId > 0) {
          CustomBlock block = MaterialData.getCustomBlock(customId);
          if (block != null) {
            light = block.getLightLevel();
          }
        }
      }
      return par1IBlockAccess.getBrightness(x, y, z, light);
    }
View Full Code Here

Examples of org.spoutcraft.api.material.CustomBlock

      int light = lightValue[par1IBlockAccess.getBlockId(x, y, z)];
      if (customIds != null) {
        int key = ((x & 0xF) << 12) | ((z & 0xF) << 8) | (y & 256);
        short customId = customIds[key];
        if (customId > 0) {
          CustomBlock block = MaterialData.getCustomBlock(customId);
          if (block != null) {
            light = block.getLightLevel();
          }
        }
      }
      return par1IBlockAccess.getLightBrightnessForSkyBlocks(x, y, z, light);
    }
View Full Code Here

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

Examples of org.spoutcraft.api.material.CustomBlock

      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

Examples of org.spoutcraft.api.material.CustomBlock

          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
TOP
Copyright © 2018 www.massapi.com. 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.