Пример #1
0
  private boolean checkFrameRadius(EntityItemFrameComparator frameComp) {

    int radius = 2;

    boolean shouldRemove = true;

    EntityItemFrame frame = frameComp.frame;

    for (int i = -radius; i <= radius; ++i) {
      for (int j = -radius; j <= radius; ++j) {
        for (int k = -radius; k <= radius; ++k) {

          if (frame.worldObj.getBlock(
                  (int) frame.posX + i, (int) frame.posY + j, (int) frame.posZ + k)
              == BlocksCommonProxy.liquidEssence) {

            Integer time = watchedFrames.get(frameComp);
            if (time == null) {
              time = 0;
            }
            time++;

            watchedFrames.put(frameComp, time);

            if (time >= processTime) {
              if (!frame.worldObj.isRemote) {
                frame.setDisplayedItem(new ItemStack(ItemsCommonProxy.arcaneCompendium));
                return true;
              }
            } else {
              shouldRemove = false;
              if (frame.worldObj.isRemote) {
                spawnCompendiumProgressParticles(
                    frame, (int) frame.posX + i, (int) frame.posY + j, (int) frame.posZ + k);
              }
            }
          }
        }
      }
    }

    return shouldRemove;
  }
  protected void hangItemFrame(
      World par1World,
      StructureBoundingBox par2StructureBoundingBox,
      int par3,
      int par4,
      int par5,
      ItemStack item) {
    int j1 = this.getXWithOffset(par3, par5);
    int k1 = this.getYWithOffset(par4);
    int l1 = this.getZWithOffset(par3, par5);

    if (!par2StructureBoundingBox.isVecInside(j1, k1, l1)) {
      return;
    }

    int i1 = this.coordBaseMode;
    EntityItemFrame itemFrame = new EntityItemFrame(par1World, j1, k1, l1, i1);
    itemFrame.setDisplayedItem(item);

    if (itemFrame.onValidSurface()) {
      par1World.spawnEntityInWorld(itemFrame);
    }
  }