Examples of ItemBackpack


Examples of forestry.storage.items.ItemBackpack

        backpack.setItemDamage(backpack.getItemDamage() + 1);
        continue;
      }

      // Load their inventory
      ItemBackpack packItem = ((ItemBackpack) backpack.getItem());
      ItemInventory backpackinventory = new ItemInventory(ItemBackpack.class, packItem.getBackpackSize(), backpack);
      Event event = new BackpackResupplyEvent(player, packItem.getDefinition(), backpackinventory);
      MinecraftForge.EVENT_BUS.post(event);
      if (event.isCanceled())
        continue;

      boolean inventoryChanged = false;
View Full Code Here

Examples of forestry.storage.items.ItemBackpack

public class BackpackHelper implements IBackpackInterface {

  @Override
  public Item addBackpack(IBackpackDefinition definition, EnumBackpackType type) {
    BackpackManager.definitions.put(definition.getKey(), definition);
    return new ItemBackpack(definition, type);
  }
View Full Code Here

Examples of forestry.storage.items.ItemBackpack

        break;

      if (!(pack.getItem() instanceof ItemBackpack))
        continue;

      ItemBackpack backpack = ((ItemBackpack) pack.getItem());
      if (backpack.getDefinition().isValidItem(player, itemstack))
        backpack.tryStowing(player, pack, itemstack);
    }

    if (itemstack == null || itemstack.stackSize <= 0)
      return false;
    else
View Full Code Here

Examples of net.mcft.copy.betterstorage.item.ItemBackpack

          backpack = new ItemStack(BetterStorageItems.itemEnderBackpack);
          // Remove drop chance for the backpack.
          ((EntityLiving)entity).setEquipmentDropChance(EquipmentSlot.CHEST, 0.0F);
        } else {
          backpack = new ItemStack(BetterStorageItems.itemBackpack, 1, RandomUtils.getInt(120, 240));
          ItemBackpack backpackType = (ItemBackpack)backpack.getItem();
          if (RandomUtils.getBoolean(0.15)) {
            // Give the backpack a random color.
            int r = RandomUtils.getInt(32, 224);
            int g = RandomUtils.getInt(32, 224);
            int b = RandomUtils.getInt(32, 224);
            int color = (r << 16) | (g << 8) | b;
            StackUtils.set(backpack, color, "display", "color");
          }
          contents = new ItemStack[backpackType.getBackpackColumns() * backpackType.getBackpackRows()];
          // Set drop chance for the backpack to 100%.
          ((EntityLiving)entity).setEquipmentDropChance(EquipmentSlot.CHEST, 1.0F);
        }
       
        // If the entity spawned with enchanted armor,
View Full Code Here

Examples of net.mcft.copy.betterstorage.item.ItemBackpack

    ItemStack backpack = ItemBackpack.getBackpackData(event.entityPlayer).backpack;
    if (backpack != null) {
     
      EntityPlayer player = event.entityPlayer;
      float partial = event.partialRenderTick;
      ItemBackpack backpackType = (ItemBackpack)backpack.getItem();
      int color = backpackType.getColor(backpack);
      ModelBackpackArmor model = (ModelBackpackArmor)backpackType.getArmorModel(player, backpack, 0);
     
      model.onGround = ReflectionUtils.invoke(
          RendererLivingEntity.class, event.renderer, "func_77040_d", "renderSwingProgress",
          EntityLivingBase.class, float.class, player, partial);
      model.setLivingAnimations(player, 0, 0, partial);
     
      RenderUtils.bindTexture(new ResourceLocation(backpackType.getArmorTexture(backpack, player, 0, null)));
      RenderUtils.setColorFromInt((color >= 0) ? color : 0xFFFFFF);
      model.render(player, 0, 0, 0, 0, 0, 0);
     
      if (color >= 0) {
        RenderUtils.bindTexture(new ResourceLocation(backpackType.getArmorTexture(backpack, player, 0, "overlay")));
        GL11.glColor3f(1.0F, 1.0F, 1.0F);
        model.render(player, 0, 0, 0, 0, 0, 0);
      }
     
      if (backpack.isItemEnchanted()) {
View Full Code Here

Examples of net.mcft.copy.betterstorage.item.ItemBackpack

public class TileEntityBackpackRenderer extends TileEntitySpecialRenderer {
 
  public void renderTileEntityAt(TileEntityBackpack backpack, double x, double y, double z, float partialTicks) {
   
    if ((backpack.getWorldObj() == null) && (backpack.blockType == null)) return;
    ItemBackpack item = ((TileBackpack)backpack.getBlockType()).getItemType();
    ItemStack stack = ((backpack.stack != null) ? backpack.stack : new ItemStack(item));
    ModelBackpack backpackModel = item.getModel();
   
    GL11.glPushMatrix();
    GL11.glEnable(GL12.GL_RESCALE_NORMAL);
    GL11.glTranslated(x, y + 2.0, z + 1.0);
    GL11.glScalef(1.0F, -1.0F, -1.0F);
    GL11.glTranslated(0.5, 0.5, 0.5);
   
    ForgeDirection orientation = ForgeDirection.getOrientation(backpack.getBlockMetadata());
    int rotation = DirectionUtils.getRotation(orientation);
    GL11.glRotatef(rotation, 0.0F, 1.0F, 0.0F);
   
    float angle = backpack.prevLidAngle + (backpack.lidAngle - backpack.prevLidAngle) * partialTicks;
    angle = 1.0F - angle;
    angle = 1.0F - angle * angle;
    backpackModel.setLidRotation((float)(angle * Math.PI / 4.0));
   
    int renderPasses = item.getRenderPasses(0);
    for (int pass = 0; pass < renderPasses; pass++) {
      String type = ((pass == 0) ? null : "overlay");
      bindTexture(new ResourceLocation(item.getArmorTexture(stack, null, 0, type)));
      RenderUtils.setColorFromInt(item.getColorFromItemStack(stack, pass));
      backpackModel.renderAll();
    }
   
    if ((backpack.stack != null) &&
        (backpack.stack.isItemEnchanted())) {
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.