Package org.spoutcraft.api.material

Examples of org.spoutcraft.api.material.CustomBlock


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


  @Override
  public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int face, float xOffset, float yOffset, float zOffset) {
    if (stack.itemID == MaterialData.flint.getRawId()) {
      int damage = stack.getItemDamage();
      if (damage >= 1024) {
        CustomBlock block = MaterialData.getCustomBlock(damage);
        // Item with no block component, return success
        if (block == null) {
          return true;
        }
        if (onItemUse(stack, block, player, world, x, y, z, face, xOffset, yOffset, zOffset)) {
View Full Code Here

    } finally {
      if (design != null && design.isReset()) {
        design = null;
      }
      if (customId != -1) {
        CustomBlock block = MaterialData.getCustomBlock(customId);
        if (block != null) {
          block.setBlockDesign(design, data);
        }
      }
    }
  }
View Full Code Here

                  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

        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

        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

          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

    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

      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

      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

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.