Package org.spoutcraft.api.block.design

Examples of org.spoutcraft.api.block.design.BlockDesign


      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


    return texture;
  }

  // Don't call this method, for future use.
  protected Texture getTextureFromItemStack(ItemStack itemStack) {
    BlockDesign design = null;
    Texture texture = null;
    org.spoutcraft.api.material.CustomItem item = MaterialData.getCustomItem(itemStack.getItemDamage());
    if (item != null) {
      String textureURI = item.getTexture();
      if (textureURI == null) {
        org.spoutcraft.api.material.CustomBlock block = MaterialData.getCustomBlock(itemStack.getItemDamage());
        design = block != null ? block.getBlockDesign() : null;
        textureURI = design != null ? design.getTextureURL() : null;
      }
      if (textureURI != null) {
        texture = CustomTextureManager.getTextureFromUrl(item.getAddon(), textureURI);       
      }     
    }
View Full Code Here

        var5.rotateAroundX(-this.rotationPitch * (float)Math.PI / 180.0F);
        var5.rotateAroundY(-this.rotationYaw * (float)Math.PI / 180.0F);
        var5 = var5.addVector(this.posX, this.posY + (double)this.getEyeHeight(), this.posZ);
        // Spout Start
        if (par1ItemStack.itemID == 318) {
          BlockDesign design = null;
          Texture texture = null;
          org.spoutcraft.api.material.CustomItem item = MaterialData.getCustomItem(par1ItemStack.getItemDamage());
          if (item != null) {
            String textureURI = item.getTexture();
            if (textureURI == null) {
              org.spoutcraft.api.material.CustomBlock block = MaterialData.getCustomBlock(par1ItemStack.getItemDamage());
              design = block != null ? block.getBlockDesign() : null;
              textureURI = design != null ? design.getTextureURL() : null;
            }
            if (textureURI != null) {
              texture = CustomTextureManager.getTextureFromUrl(item.getAddon(), textureURI);
            }
          }
View Full Code Here

        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

        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

    GL11.glPushMatrix();
    TextureManager var99 = this.mc.getTextureManager();
    // Spout Start
    Block var4block = Block.blocksList[par2ItemStack.itemID];
    boolean custom = false;
    BlockDesign design = null;
    if (par2ItemStack.itemID == 318) {
      org.spoutcraft.api.material.CustomItem item = MaterialData.getCustomItem(par2ItemStack.getItemDamage());
      if (item != null) {
        String textureURI = item.getTexture();
        if (textureURI == null) {
          org.spoutcraft.api.material.CustomBlock block = MaterialData.getCustomBlock(par2ItemStack.getItemDamage());
          design = block != null ? block.getBlockDesign() : null;
          textureURI = design != null ? design.getTextureURL() : null;
        }
        if (textureURI != null) {
          Texture texture = CustomTextureManager.getTextureFromUrl(item.getAddon(), textureURI);
          if (texture != null) {
            SpoutClient.getHandle().renderEngine.bindTexture(texture.getTextureID());
            custom = true;
          }
        }
      }
    }

    if (!custom) {
      if (par2ItemStack.itemID < 256) {
        this.mc.getTextureManager().bindTexture(TextureMap.locationBlocksTexture);
      } else {
        this.mc.getTextureManager().bindTexture(TextureMap.locationItemsTexture);
      }
    }

    if (design != null) {
      GL11.glDisable(GL11.GL_LIGHTING);
      design.renderItemstack(null, -0.5F, -0.5F, -0.5F, 0, 1F, rand);
      GL11.glEnable(GL11.GL_LIGHTING);
    }
    else if(var4block != null && RenderBlocks.renderItemIn3d(var4block.getRenderType())) {
      this.renderBlocksInstance.renderBlockAsItem(Block.blocksList[par2ItemStack.itemID], par2ItemStack.getItemDamage(), 1.0F);
    } else {
View Full Code Here

        var13 = 5;
      }

      // Spout Start
      boolean custom = false;
      BlockDesign design = null;
      if (var10.itemID == 318) {
        org.spoutcraft.api.material.CustomItem item = MaterialData.getCustomItem(var10.getItemDamage());
        if (item != null) {
          String textureURI = item.getTexture();
          if (textureURI == null) {
            org.spoutcraft.api.material.CustomBlock block = MaterialData.getCustomBlock(var10.getItemDamage());
            design = block != null ? block.getBlockDesign() : null;
            textureURI = design != null ? design.getTextureURL() : null;
          }
          if (textureURI != null) {
            Texture texture = CustomTextureManager.getTextureFromUrl(item.getAddon(), textureURI);
            if (texture != null) {
              SpoutClient.getHandle().renderEngine.bindTexture(texture.getTextureID());
              custom = true;
            }
          }
        }
      }
      GL11.glEnable(GL12.GL_RESCALE_NORMAL);

      if (design != null && custom) {
        //GL11.glScalef(0.25F, 0.25F, 0.25F);
        design.renderItemstack(par1EntityItem.getEntityItem(), (float)par2, (float)(par4 + var11), (float)par6, var12, 0.25F, random);
      } else {
        GL11.glPushMatrix(); // the push from above
        if (!custom) {
          if (var10.itemID < 256) {
            Minecraft.getMinecraft().getTextureManager().bindTexture(new ResourceLocation("textures/atlas/blocks.png"));
View Full Code Here

    float var12;
    float var13;

    // Spout Start
    boolean custom = false;
    BlockDesign design = null;
    if (var6 == 318) {
      org.spoutcraft.api.material.CustomItem item = MaterialData.getCustomItem(var7);
      if (item != null) {
        String textureURI = item.getTexture();
        if (textureURI == null) {
          org.spoutcraft.api.material.CustomBlock block = MaterialData.getCustomBlock(var7);
          design = block != null ? block.getBlockDesign() : null;
          textureURI = design != null ? design.getTextureURL() : null;
        }
        if (textureURI != null) {
          Texture texture = CustomTextureManager.getTextureFromUrl(item.getAddon(), textureURI);
          if (texture != null) {
            Minecraft.getMinecraft().getTextureManager().bindTexture(texture.getTextureID());
            custom = true;
          }
        }
      }
    }
    if (!custom) {
      if (var6 < 256) {
        Minecraft.getMinecraft().getTextureManager().bindTexture(new ResourceLocation("textures/atlas/blocks.png"));
      } else {
        Minecraft.getMinecraft().getTextureManager().bindTexture(new ResourceLocation("textures/atlas/items.png"));
      }
    }

    if (design != null && custom) {
      GL11.glDisable(GL11.GL_LIGHTING);
      design.renderItemOnHUD((float)(par4 - 2), (float)(par5 + 3), -3.0F + this.zLevel);
      GL11.glEnable(GL11.GL_LIGHTING);
    } else if (par3ItemStack.getItemSpriteNumber() == 0 && RenderBlocks.renderItemIn3d(Block.blocksList[var6].getRenderType())) {
      Minecraft.getMinecraft().getTextureManager().bindTexture(new ResourceLocation("textures/atlas/blocks.png"));
      Block var15 = Block.blocksList[var6];
      GL11.glPushMatrix();
View Full Code Here

TOP

Related Classes of org.spoutcraft.api.block.design.BlockDesign

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.