protected Item getDropItem() {
   boolean flag = this.rand.nextInt(4) == 0;
   int i = this.getHorseType();
   return i == 4
       ? Items.bone
       : (i == 3 ? (flag ? Item.getItemById(0) : Items.rotten_flesh) : Items.leather);
 }
  /**
   * Drop 0-2 items of this living's type. @param par1 - Whether this entity has recently been hit
   * by a player. @param par2 - Level of Looting used to kill this mob.
   */
  @Override
  protected void dropFewItems(boolean par1, int par2) {
    super.dropFewItems(par1, par2);

    if (par1 && (this.rand.nextInt(3) == 0 || this.rand.nextInt(1 + par2) > 0)) {
      this.dropItem(Item.getItemById(375), 1);
    }
  }
    public void readFromNBT(NBTTagCompound compound) {
      super.readFromNBT(compound);

      if (compound.hasKey("RecordItem", 10)) {
        this.setRecord(ItemStack.loadItemStackFromNBT(compound.getCompoundTag("RecordItem")));
      } else if (compound.getInteger("Record") > 0) {
        this.setRecord(new ItemStack(Item.getItemById(compound.getInteger("Record"))));
      }
    }
Example #4
0
 private static void addAspect(
     EntityPlayer player, ScanResult scan, double chanceToIncrease, double increaseMult) {
   Thaumcraft.proxy
       .getResearchManager()
       .completeScannedObject(
           player, "@" + ScanManager.generateItemHash(Item.getItemById(scan.id), scan.meta));
   AspectList aspects =
       ThaumcraftCraftingManager.getObjectTags(
           new ItemStack(Item.getItemById(scan.id), 1, scan.meta));
   if (aspects != null) {
     PlayerKnowledge pk = Thaumcraft.proxy.getPlayerKnowledge();
     for (Aspect aspect : aspects.getAspects()) {
       if (pk.hasDiscoveredParentAspects(player.getCommandSenderName(), aspect)) {
         int amt = aspects.getAmount(aspect);
         if (chanceToIncrease > 0d && player.getEntityWorld().rand.nextDouble() < chanceToIncrease)
           amt = MathHelper.ceiling_double_int((double) amt * increaseMult);
         ScanManager.checkAndSyncAspectKnowledge(player, aspect, amt);
       }
     }
   }
 }
 public ItemStack getNextPlannedItem() {
   if (spellGuide != null) {
     if ((this.allAddedItems.size()) * 3 < spellGuide.length) {
       int guide_id = spellGuide[(this.allAddedItems.size()) * 3];
       int guide_qty = spellGuide[((this.allAddedItems.size()) * 3) + 1];
       int guide_meta = spellGuide[((this.allAddedItems.size()) * 3) + 2];
       ItemStack stack = new ItemStack(Item.getItemById(guide_id), guide_qty, guide_meta);
       return stack;
     } else {
       return new ItemStack(ItemsCommonProxy.spellParchment);
     }
   }
   return null;
 }
  public static int getItemTem(ItemStack stack) {
    if (stack == null) {
      return 0;
    } else {
      Item item = stack.getItem();
      if (item instanceof ItemBlock && Block.getBlockFromItem(item) != Blocks.air) {
        Block block = Block.getBlockFromItem(item);
        if (block == Blocks.wooden_slab) {
          return 1;
        }

        if (block.getMaterial() == Material.wood) {
          return 5;
        }

        if (block == Blocks.coal_block) {
          return 500;
        }

        if (block == Blocks.ice) {
          return -100;
        }
      }
      if (item instanceof ItemTool && ((ItemTool) item).getToolMaterialName().equals("WOOD"))
        return 2;
      if (item instanceof ItemSword && ((ItemSword) item).getToolMaterialName().equals("WOOD"))
        return 2;
      if (item instanceof ItemHoe && ((ItemHoe) item).getToolMaterialName().equals("WOOD"))
        return 2;
      if (item == Item.getItemById(280)) return 1;
      if (item == Item.getItemById(263)) return 100;
      if (item == Item.getItemById(327)) return 1500;
      if (item == Item.getItemFromBlock(Blocks.sapling)) return 1;
      if (item == Item.getItemById(369)) return 150;
      return (int) Math.floor(GameRegistry.getFuelValue(stack) / 16.0F);
    }
  }
Example #7
0
  /** Called when the mob's health reaches 0. */
  public void onDeath(DamageSource cause) {
    super.onDeath(cause);

    if (cause.getEntity() instanceof EntitySkeleton) {
      int i = Item.getIdFromItem(Items.record_13);
      int j = Item.getIdFromItem(Items.record_wait);
      int k = i + this.rand.nextInt(j - i + 1);
      this.dropItem(Item.getItemById(k), 1);
    } else if (cause.getEntity() instanceof EntityCreeper
        && cause.getEntity() != this
        && ((EntityCreeper) cause.getEntity()).getPowered()
        && ((EntityCreeper) cause.getEntity()).isAIEnabled()) {
      ((EntityCreeper) cause.getEntity()).func_175493_co();
      this.entityDropItem(new ItemStack(Items.skull, 1, 4), 0.0F);
    }
  }
Example #8
0
  @Override
  public void receiveCommand(String command, Side side, Object sender, ByteBuf stream) {
    super.receiveCommand(command, side, sender, stream);
    if (side.isClient()) {
      if ("clearItemRequirements".equals(command)) {
        requiredToBuild = null;
      } else if ("setItemRequirements".equals(command)) {
        int size = stream.readUnsignedMedium();
        requiredToBuild = new ArrayList<RequirementItemStack>();
        for (int i = 0; i < size; i++) {
          int itemId = stream.readUnsignedShort();
          int itemDamage = stream.readShort();
          int stackSize = stream.readUnsignedMedium();
          boolean hasCompound = stackSize >= 0x800000;

          ItemStack stack = new ItemStack(Item.getItemById(itemId), 1, itemDamage);
          if (hasCompound) {
            stack.setTagCompound(NetworkUtils.readNBT(stream));
          }

          if (stack != null && stack.getItem() != null) {
            requiredToBuild.add(new RequirementItemStack(stack, stackSize & 0x7FFFFF));
          } else {
            BCLog.logger.error(
                "Corrupt ItemStack in TileBuilder.receiveCommand! This should not happen! (ID "
                    + itemId
                    + ", damage "
                    + itemDamage
                    + ")");
          }
        }
      }
    } else if (side.isServer()) {
      EntityPlayer player = (EntityPlayer) sender;
      if ("eraseFluidTank".equals(command)) {
        int id = stream.readInt();
        if (id < 0 || id >= fluidTanks.length) {
          return;
        }
        if (isUseableByPlayer(player) && player.getDistanceSq(xCoord, yCoord, zCoord) <= 64) {
          fluidTanks[id].setFluid(null);
          sendNetworkUpdate();
        }
      }
    }
  }
  @Override
  protected void readSyncTag(NBTTagCompound NBT) {
    super.readSyncTag(NBT);

    digging = NBT.getBoolean("dig");
    digReady = NBT.getBoolean("dig2");
    finishedDigging = NBT.getBoolean("finish");
    index = NBT.getInteger("index");

    dropFlag = NBT.getBoolean("dropped");

    found.clear();
    NBTTagList li = NBT.getTagList("count", NBTTypes.COMPOUND.ID);
    for (Object o : li.tagList) {
      NBTTagCompound tag = (NBTTagCompound) o;
      int id = tag.getInteger("id");
      int meta = tag.getInteger("meta");
      int count = tag.getInteger("count");
      ItemStack is = new ItemStack(Item.getItemById(id), 1, meta);
      found.put(is, count);
    }
  }
  /**
   * this is a method for handling packets that were sent to the client.
   *
   * @param manager
   * @param packet
   * @param player
   * @param dat the data that it can read from
   * @param ID the packet ID
   */
  public void handleClientPacket(
      Packet packet, EntityPlayer player, ByteArrayDataInput dat, short ID) {
    EntityPlayer thePlayer = (EntityPlayer) player;
    World world = thePlayer.worldObj;

    if (world != null) {
      if (FMLClientHandler.instance().getClient().currentScreen instanceof GuiAPressurePlate) {
        if (ID == 1) {
          int coords[] = new int[3];

          for (int var1 = 0; var1 < 3; var1++) {
            coords[var1] = dat.readInt();
          }

          if (GuiAPressurePlate.tpp.xCoord == coords[0]
              && GuiAPressurePlate.tpp.yCoord == coords[1]
              && GuiAPressurePlate.tpp.zCoord == coords[2]) {
            ((EntityPlayerSP) thePlayer).closeScreen();
          }

          return;
        }

        if (ID == 2) {
          int coords[] = new int[3];

          for (int var1 = 0; var1 < 3; var1++) {
            coords[var1] = dat.readInt();
          }

          int allowedmobs = dat.readInt();

          if (GuiAPressurePlate.tpp.xCoord == coords[0]
              && GuiAPressurePlate.tpp.yCoord == coords[1]
              && GuiAPressurePlate.tpp.zCoord == coords[2]) {
            for (int var1 = 0; var1 < allowedmobs; var1++) {
              boolean bool = dat.readBoolean();
              GuiAPressurePlate.enabled[var1] = bool;
            }
          }

          return;
        }

        if (ID == 3) {
          int coords[] = new int[3];

          for (int var1 = 0; var1 < 3; var1++) {
            coords[var1] = dat.readInt();
          }

          if (GuiAPressurePlate.tpp.xCoord == coords[0]
              && GuiAPressurePlate.tpp.yCoord == coords[1]
              && GuiAPressurePlate.tpp.zCoord == coords[2]) {
            GuiAPressurePlate.tpp.allowedPlayers.clear();
            int allowedPlayers = dat.readInt();
            {
              for (int var1 = 0; var1 < allowedPlayers; var1++) {
                short nameLength = dat.readShort();
                String username = "";

                for (int var2 = 0; var2 < nameLength; var2++) {
                  username = new StringBuilder().append(username).append(dat.readChar()).toString();
                }

                boolean bool = dat.readBoolean();
                GuiAPressurePlate.tpp.addPlayer(username);
                GuiAPressurePlate.tpp.setEnabledForPlayer(username, bool);
              }

              GuiAPressurePlate.lineUp();
            }
          }

          return;
        }

        if (ID == 4) {
          int coords[] = new int[3];

          for (int var1 = 0; var1 < 3; var1++) {
            coords[var1] = dat.readInt();
          }

          int index = dat.readInt();

          if (GuiAPressurePlate.tpp.xCoord == coords[0]
              && GuiAPressurePlate.tpp.yCoord == coords[1]
              && GuiAPressurePlate.tpp.zCoord == coords[2]) {
            GuiAPressurePlate.switchbutton(index);
          }

          return;
        }

        if (ID == 11) {
          int coords[] = new int[3];

          for (int var1 = 0; var1 < 3; var1++) {
            coords[var1] = dat.readInt();
          }

          if (GuiAPressurePlate.tpp.xCoord == coords[0]
              && GuiAPressurePlate.tpp.yCoord == coords[1]
              && GuiAPressurePlate.tpp.zCoord == coords[2]) {
            if (GuiAPressurePlate.tpp.settings == null) {
              GuiAPressurePlate.tpp.registerSettings();
            }

            int var2 = dat.readInt();

            for (int var3 = 0; var3 < var2; var3++) {
              if (var3 <= GuiAPressurePlate.tpp.settings.size()) {
                GuiAPressurePlate.tpp.setSetting(var3, dat.readBoolean());
              }
            }

            GuiAPressurePlate.LineUpSettings();
          }

          return;
        }

        if (ID == 10) {
          int coords[] = new int[3];

          for (int var1 = 0; var1 < 3; var1++) {
            coords[var1] = dat.readInt();
          }

          if (GuiAPressurePlate.tpp.xCoord == coords[0]
              && GuiAPressurePlate.tpp.yCoord == coords[1]
              && GuiAPressurePlate.tpp.zCoord == coords[2]) {
            int var2 = dat.readInt();

            if (GuiAPressurePlate.tpp.settings.size() >= var2) {
              GuiAPressurePlate.tpp.switchSetting(var2);
            }
          }

          return;
        }
      }

      if (FMLClientHandler.instance().getClient().currentScreen instanceof GuiModifyPressurePlate) {
        if (ID == 1) {
          int coords[] = new int[3];

          for (int var1 = 0; var1 < 3; var1++) {
            coords[var1] = dat.readInt();
          }

          if (GuiAPressurePlate.tpp.xCoord == coords[0]
              && GuiAPressurePlate.tpp.yCoord == coords[1]
              && GuiAPressurePlate.tpp.zCoord == coords[2]) {
            ((EntityPlayerSP) thePlayer).closeScreen();
          }
        }

        if (ID == 3) {
          int coords[] = new int[3];

          for (int var1 = 0; var1 < 3; var1++) {
            coords[var1] = dat.readInt();
          }

          if (GuiAPressurePlate.tpp.xCoord == coords[0]
              && GuiAPressurePlate.tpp.yCoord == coords[1]
              && GuiAPressurePlate.tpp.zCoord == coords[2]) {
            GuiAPressurePlate.tpp.allowedPlayers.clear();
            int allowedPlayers = dat.readInt();
            {
              for (int var1 = 0; var1 < allowedPlayers; var1++) {
                short nameLength = dat.readShort();
                String username = "";

                for (int var2 = 0; var2 < nameLength; var2++) {
                  username = new StringBuilder().append(username).append(dat.readChar()).toString();
                }

                boolean bool = dat.readBoolean();
                GuiAPressurePlate.tpp.setEnabledForPlayer(username, bool);
              }

              GuiAPressurePlate.lineUp();
            }
          }

          return;
        }

        if (ID == 4) {
          int coords[] = new int[3];

          for (int var1 = 0; var1 < 3; var1++) {
            coords[var1] = dat.readInt();
          }

          int index = dat.readInt();

          if (GuiAPressurePlate.tpp.xCoord == coords[0]
              && GuiAPressurePlate.tpp.yCoord == coords[1]
              && GuiAPressurePlate.tpp.zCoord == coords[2]) {
            GuiAPressurePlate.switchbutton(index);
          }

          return;
        }

        if (ID == 5) {
          int coords[] = new int[3];

          for (int var1 = 0; var1 < 3; var1++) {
            coords[var1] = dat.readInt();
          }

          if (GuiAPressurePlate.tpp.xCoord == coords[0]
              && GuiAPressurePlate.tpp.yCoord == coords[1]
              && GuiAPressurePlate.tpp.zCoord == coords[2]) {
            boolean bool = dat.readBoolean();
            int usernamelength = dat.readInt();
            String username = "";

            for (int var2 = 0; var2 < usernamelength; var2++) {
              char c = dat.readChar();
              username = new StringBuilder().append(username).append(c).toString();
            }

            if (thePlayer.getCommandSenderName().matches(username)) {
              if (bool) {
                GuiModifyPressurePlate.showText("Player added", 20);
              } else {
                GuiModifyPressurePlate.showText("Player is already in list", 20);
              }
            }
          }

          return;
        }

        if (ID == 6) {
          int coords[] = new int[3];

          for (int var1 = 0; var1 < 3; var1++) {
            coords[var1] = dat.readInt();
          }

          if (GuiAPressurePlate.tpp.xCoord == coords[0]
              && GuiAPressurePlate.tpp.yCoord == coords[1]
              && GuiAPressurePlate.tpp.zCoord == coords[2]) {
            boolean bool = dat.readBoolean();
            int usernamelength = dat.readInt();
            String username = "";

            for (int var2 = 0; var2 < usernamelength; var2++) {
              char c = dat.readChar();
              username = new StringBuilder().append(username).append(c).toString();
            }

            if (thePlayer.getCommandSenderName().matches(username)) {
              if (bool) {
                GuiModifyPressurePlate.showText("Player removed", 20);
              } else {
                GuiModifyPressurePlate.showText("Player is not in list", 20);
              }
            }
          }

          return;
        }

        if (ID == 10) {
          int coords[] = new int[3];

          for (int var1 = 0; var1 < 3; var1++) {
            coords[var1] = dat.readInt();
          }

          if (GuiAPressurePlate.tpp.xCoord == coords[0]
              && GuiAPressurePlate.tpp.yCoord == coords[1]
              && GuiAPressurePlate.tpp.zCoord == coords[2]) {
            int index = dat.readInt();

            if (GuiAPressurePlate.tpp.settings.size() >= index) {
              GuiAPressurePlate.tpp.switchSetting(index);
            }
          }

          return;
        }

        if (ID == 11) {
          int coords[] = new int[3];

          for (int var1 = 0; var1 < 3; var1++) {
            coords[var1] = dat.readInt();
          }

          if (GuiAPressurePlate.tpp.xCoord == coords[0]
              && GuiAPressurePlate.tpp.yCoord == coords[1]
              && GuiAPressurePlate.tpp.zCoord == coords[2]) {
            if (GuiAPressurePlate.tpp.settings == null) {
              GuiAPressurePlate.tpp.registerSettings();
            }

            int var2 = dat.readInt();

            for (int var3 = 0; var3 < var2; var3++) {
              if (var3 <= GuiAPressurePlate.tpp.settings.size()) {
                GuiAPressurePlate.tpp.setSetting(var3, dat.readBoolean());
              }
            }

            GuiAPressurePlate.LineUpSettings();
          }

          return;
        }
      }

      if (FMLClientHandler.instance().getClient().currentScreen instanceof GuiPassword) {
        if (ID == 12) {
          int coords[] = new int[3];

          for (int var1 = 0; var1 < 3; var1++) {
            coords[var1] = dat.readInt();
          }

          int length = dat.readInt();
          StringBuilder sb = new StringBuilder();

          for (int var1 = 0; var1 < length; var1++) {
            sb.append(dat.readChar());
          }

          String name = sb.toString();

          if (((GuiPassword) FMLClientHandler.instance().getClient().currentScreen).tpp != null
              && ((GuiPassword) FMLClientHandler.instance().getClient().currentScreen).tpp.xCoord
                  == coords[0]
              && ((GuiPassword) FMLClientHandler.instance().getClient().currentScreen).tpp.yCoord
                  == coords[1]
              && ((GuiPassword) FMLClientHandler.instance().getClient().currentScreen).tpp.zCoord
                  == coords[2]) {
            if (name.matches(thePlayer.getCommandSenderName())) {
              GuiPassword gui = (GuiPassword) FMLClientHandler.instance().getClient().currentScreen;
              gui.enterGui();
            }
          }

          return;
        }

        if (ID == 13) {
          int coords[] = new int[3];

          for (int var1 = 0; var1 < 3; var1++) {
            coords[var1] = dat.readInt();
          }

          boolean b = dat.readBoolean();

          if (((GuiPassword) FMLClientHandler.instance().getClient().currentScreen).tpp != null
              && ((GuiPassword) FMLClientHandler.instance().getClient().currentScreen).tpp.xCoord
                  == coords[0]
              && ((GuiPassword) FMLClientHandler.instance().getClient().currentScreen).tpp.yCoord
                  == coords[1]
              && ((GuiPassword) FMLClientHandler.instance().getClient().currentScreen).tpp.zCoord
                  == coords[2]) {
            GuiPassword gui = (GuiPassword) FMLClientHandler.instance().getClient().currentScreen;

            if (b) {
              gui.enterGui();
            } else {
              GuiPassword.showText("Wrong Password!!!", 20);
            }
          }

          return;
        }

        if (ID == 15) {
          return;
        }

        if (ID == 18) {
          int guiID = dat.readInt();

          if (FMLClientHandler.instance().getClient().currentScreen != null
              && FMLClientHandler.instance().getClient().currentScreen instanceof GuiPassword) {
            GuiPassword gui = (GuiPassword) FMLClientHandler.instance().getClient().currentScreen;
            gui.set = guiID;
          }

          return;
        }
      }

      if (ID == 7) {
        int coords[] = new int[3];

        for (int var1 = 0; var1 < 3; var1++) {
          coords[var1] = dat.readInt();
        }

        TileEntity te = world.getTileEntity(coords[0], coords[1], coords[2]);
        TileEntityPressurePlate tpp = null;

        if (te != null || te instanceof TileEntityPressurePlate) {
          tpp = (TileEntityPressurePlate) te;
        }

        int itemId = dat.readInt();
        int stackSize = dat.readInt();
        int itemDamage = dat.readInt();
        int dimension = dat.readInt();

        if (!PPRegistry.getContainsPressurePlate(coords[0], coords[1], coords[2], dimension)) {
          PPRegistry.addPressurePlate(coords[0], coords[1], coords[2], dimension, false, null);
        }

        if (itemId == 0 && stackSize == 0 & itemDamage == 0) {
          if (tpp != null) {
            tpp.item[0] = null;
          }

          PPRegistry.setItem(coords[0], coords[1], coords[2], dimension, null);
          world.markBlockForUpdate(coords[0], coords[1], coords[2]);
        } else {
          if (tpp != null) {
            tpp.item[0] = new ItemStack(Item.getItemById(itemId), stackSize, itemDamage);
          }

          PPRegistry.setItem(
              coords[0],
              coords[1],
              coords[2],
              dimension,
              new ItemStack(Item.getItemById(itemId), stackSize, itemDamage));
          world.markBlockForUpdate(coords[0], coords[1], coords[2]);
        }

        return;
      }

      if (ID == 8) {
        int coords[] = new int[3];

        for (int var1 = 0; var1 < 3; var1++) {
          coords[var1] = dat.readInt();
        }

        TileEntity te = world.getTileEntity(coords[0], coords[1], coords[2]);
        TileEntityPressurePlate tpp = null;

        if (te == null || !(te instanceof TileEntityPressurePlate)) {
          world.setTileEntity(coords[0], coords[1], coords[2], new TileEntityPressurePlate());
          tpp = (TileEntityPressurePlate) te;
        } else {
          tpp = (TileEntityPressurePlate) te;
        }

        if (tpp != null) {
          tpp.currentOutput = dat.readInt();
        }

        world.markBlockForUpdate(coords[0], coords[1], coords[2]);
        return;
      }

      if (ID == 9) {
        PPRegistry.sendToServer = true;
        return;
      }

      if (ID == 11) {
        int coords[] = new int[3];

        for (int var1 = 0; var1 < 3; var1++) {
          coords[var1] = dat.readInt();
        }

        TileEntity te = world.getTileEntity(coords[0], coords[1], coords[2]);
        TileEntityPressurePlate tpp = null;

        if (te != null || te instanceof TileEntityPressurePlate) {
          tpp = (TileEntityPressurePlate) te;
        }

        if (tpp != null) {
          if (tpp.xCoord == coords[0] && tpp.yCoord == coords[1] && tpp.zCoord == coords[2]) {
            if (tpp.settings == null) {
              tpp.registerSettings();
            }

            int var2 = dat.readInt();

            for (int var3 = 0; var3 < var2; var3++) {
              if (var3 <= tpp.settings.size()) {
                tpp.setSetting(var3, dat.readBoolean());
              }
            }
          }
        }

        return;
      }

      if (ID == 12) {
        int coords[] = new int[3];

        for (int var1 = 0; var1 < 3; var1++) {
          coords[var1] = dat.readInt();
        }

        int length = dat.readInt();
        StringBuilder sb = new StringBuilder();

        for (int var1 = 0; var1 < length; var1++) {
          sb.append(dat.readChar());
        }

        sb.toString();
        return;
      }

      if (ID == 14) {
        int coords[] = new int[3];

        for (int var1 = 0; var1 < 3; var1++) {
          coords[var1] = dat.readInt();
        }

        TileEntity te = world.getTileEntity(coords[0], coords[1], coords[2]);
        if (te != null || te instanceof TileEntityPressurePlate) {}

        int dimension = dat.readInt();

        if (!PPRegistry.getContainsPressurePlate(coords[0], coords[1], coords[2], dimension)) {
          PPRegistry.addPressurePlate(coords[0], coords[1], coords[2], dimension, false, null);
        }

        PPRegistry.setUsesPassword(coords[0], coords[1], coords[2], dimension, dat.readBoolean());
        return;
      }

      if (ID == 16) {
        int coords[] = new int[3];

        for (int var1 = 0; var1 < 3; var1++) {
          coords[var1] = dat.readInt();
        }

        TileEntity te = world.getTileEntity(coords[0], coords[1], coords[2]);
        TileEntityPressurePlate tpp = null;

        if (te != null || te instanceof TileEntityPressurePlate) {
          tpp = (TileEntityPressurePlate) te;
        }

        int dimension = dat.readInt();

        if (tpp != null) {
          PPRegistry.removePressurePlate(tpp, dimension);
        }

        return;
      }

      if (ID == 17) {
        int coords[] = new int[3];

        for (int var1 = 0; var1 < 3; var1++) {
          coords[var1] = dat.readInt();
        }

        TileEntity te = world.getTileEntity(coords[0], coords[1], coords[2]);
        TileEntityPressurePlate tpp = null;

        if (te != null || te instanceof TileEntityPressurePlate) {
          tpp = (TileEntityPressurePlate) te;
        }

        int dimension = dat.readInt();

        if (tpp != null) {
          PPRegistry.addPressurePlate(tpp, dimension);
        }

        return;
      }
      if (ID == 19) {
        int coords[] = new int[3];

        for (int var1 = 0; var1 < 3; var1++) {
          coords[var1] = dat.readInt();
        }

        TileEntity te = world.getTileEntity(coords[0], coords[1], coords[2]);
        if (te instanceof TileEntityPressurePlate) {
          if (!(FMLClientHandler.instance().getClient().currentScreen
              instanceof GuiAPressurePlate)) {
            ((TileEntityPressurePlate) te).maxOutput = dat.readInt();
            ((TileEntityPressurePlate) te).itemsForMax = dat.readInt();
          } else if (GuiAPressurePlate.tpp != te || GuiAPressurePlate.hasData == false) {
            ((TileEntityPressurePlate) te).maxOutput = dat.readInt();
            ((TileEntityPressurePlate) te).itemsForMax = dat.readInt();
            GuiAPressurePlate.hasData = true;
          }
        }
      }
    }
  }
Example #11
0
 protected Item func_146068_u() {
   return this.getSlimeSize() == 1 ? Items.slime_ball : Item.getItemById(0);
 }
 protected Item getDropItem() {
   return Item.getItemById(0);
 }
 /** Returns the item ID for the item the mob drops on death. */
 @Override
 protected Item getDropItem() {
   return Item.getItemById(287);
 }
Example #14
0
 protected Item func_146068_u() {
   return Item.getItemById(0);
 }
 protected Item getDropItem() {
   return this.getSlimeSize() == 1 ? CMContent.blueslimeball : Item.getItemById(0);
 }
 public void readFromNBT(NBTTagCompound compound) {
   super.readFromNBT(compound);
   this.flowerPotItem = Item.getItemById(compound.getInteger("Item"));
   this.flowerPotData = compound.getInteger("Data");
 }
 /** Gets an item for the block being called on. Args: world, x, y, z */
 @SideOnly(Side.CLIENT)
 public Item getItem(World world, int x, int y, int z) {
   return this.block == PineappleBlocks.pineapple_block
       ? PineappleItems.pineapple_seeds
       : Item.getItemById(0);
 }
 @Override
 protected Item getDropItem() {
   return this.getSlimeSize() == 1 ? Items.slime_ball : Item.getItemById(0);
 }