public void a(NBTTagCompound nbttagcompound) {
   super.a(nbttagcompound);
   this.a = Block.getById(nbttagcompound.getInt("blockId"));
   this.i = nbttagcompound.getInt("blockData");
   this.j = nbttagcompound.getInt("facing");
   this.n = this.m = nbttagcompound.getFloat("progress");
   this.k = nbttagcompound.getBoolean("extending");
 }
Exemple #2
0
 public void a(NBTTagCompound nbttagcompound) {
   super.a(nbttagcompound);
   this.a = nbttagcompound.getInt("blockId");
   this.b = nbttagcompound.getInt("blockData");
   this.c = nbttagcompound.getInt("facing");
   this.g = this.f = nbttagcompound.getFloat("progress");
   this.d = nbttagcompound.getBoolean("extending");
 }
 public void a(NBTTagCompound var1) {
   super.a(var1);
   this.color = var1.getInt("Base");
   this.patterns = var1.getList("Patterns", 10);
   this.h = null;
   this.i = null;
   this.j = null;
   this.g = true;
 }
 public void a(NBTTagCompound nbttagcompound) {
   super.a(nbttagcompound);
   this.a = nbttagcompound.getByte("SkullType");
   this.i = nbttagcompound.getByte("Rot");
   if (this.a == 3) {
     if (nbttagcompound.hasKeyOfType("Owner", 10)) {
       this.j = GameProfileSerializer.a(nbttagcompound.getCompound("Owner"));
     } else if (nbttagcompound.hasKeyOfType("ExtraType", 8)
         && !UtilColor.b(nbttagcompound.getString("ExtraType"))) {
       this.j = new GameProfile((UUID) null, nbttagcompound.getString("ExtraType"));
       this.d();
     }
   }
 }
  public void a(NBTTagCompound nbttagcompound) {
    super.a(nbttagcompound);
    NBTTagList nbttaglist = nbttagcompound.getList("Items");

    this.items = new ItemStack[this.getSize()];

    for (int i = 0; i < nbttaglist.size(); ++i) {
      NBTTagCompound nbttagcompound1 = (NBTTagCompound) nbttaglist.get(i);
      byte b0 = nbttagcompound1.getByte("Slot");

      if (b0 >= 0 && b0 < this.items.length) {
        this.items[b0] = ItemStack.a(nbttagcompound1);
      }
    }

    this.brewTime = nbttagcompound.getShort("BrewTime");
  }
  public void a(NBTTagCompound nbttagcompound) {
    super.a(nbttagcompound);
    NBTTagList nbttaglist = nbttagcompound.getList("Items", 10);

    this.items = new ItemStack[this.getSize()];
    if (nbttagcompound.hasKeyOfType("CustomName", 8)) {
      this.s = nbttagcompound.getString("CustomName");
    }

    for (int i = 0; i < nbttaglist.size(); ++i) {
      NBTTagCompound nbttagcompound1 = nbttaglist.get(i);
      int j = nbttagcompound1.getByte("Slot") & 255;

      if (j >= 0 && j < this.items.length) {
        this.items[j] = ItemStack.createStack(nbttagcompound1);
      }
    }
  }
  public void a(NBTTagCompound nbttagcompound) {
    super.a(nbttagcompound);
    NBTTagList nbttaglist = nbttagcompound.m("Items");

    this.i = new ItemStack[this.j_()];
    if (nbttagcompound.b("CustomName")) {
      this.s = nbttagcompound.i("CustomName");
    }

    for (int i0 = 0; i0 < nbttaglist.c(); ++i0) {
      NBTTagCompound nbttagcompound1 = (NBTTagCompound) nbttaglist.b(i0);
      int i1 = nbttagcompound1.c("Slot") & 255;

      if (i1 >= 0 && i1 < this.i.length) {
        this.i[i1] = ItemStack.a(nbttagcompound1);
      }
    }
  }
  public void a(NBTTagCompound nbttagcompound) {
    super.a(nbttagcompound);
    NBTTagList nbttaglist = nbttagcompound.getList("Items", 10);

    this.a = new ItemStack[this.getSize()];
    if (nbttagcompound.hasKeyOfType("CustomName", 8)) {
      this.i = nbttagcompound.getString("CustomName");
    }

    this.j = nbttagcompound.getInt("TransferCooldown");

    for (int i = 0; i < nbttaglist.size(); ++i) {
      NBTTagCompound nbttagcompound1 = nbttaglist.get(i);
      byte b0 = nbttagcompound1.getByte("Slot");

      if (b0 >= 0 && b0 < this.a.length) {
        this.a[b0] = ItemStack.createStack(nbttagcompound1);
      }
    }
  }
Exemple #9
0
  public static TileEntity c(NBTTagCompound nbttagcompound) {
    TileEntity tileentity = null;

    try {
      Class oclass = (Class) i.get(nbttagcompound.getString("id"));

      if (oclass != null) {
        tileentity = (TileEntity) oclass.newInstance();
      }
    } catch (Exception exception) {
      exception.printStackTrace();
    }

    if (tileentity != null) {
      tileentity.a(nbttagcompound);
    } else {
      a.warn("Skipping BlockEntity with id " + nbttagcompound.getString("id"));
    }

    return tileentity;
  }
  @Override
  public BlockState getBlockState() {
    if (blockEntityTag != null) {
      switch (material) {
        case SHIELD:
          blockEntityTag.setString("id", "banner");
          break;
        case WHITE_SHULKER_BOX:
        case ORANGE_SHULKER_BOX:
        case MAGENTA_SHULKER_BOX:
        case LIGHT_BLUE_SHULKER_BOX:
        case YELLOW_SHULKER_BOX:
        case LIME_SHULKER_BOX:
        case PINK_SHULKER_BOX:
        case GRAY_SHULKER_BOX:
        case SILVER_SHULKER_BOX:
        case CYAN_SHULKER_BOX:
        case PURPLE_SHULKER_BOX:
        case BLUE_SHULKER_BOX:
        case BROWN_SHULKER_BOX:
        case GREEN_SHULKER_BOX:
        case RED_SHULKER_BOX:
        case BLACK_SHULKER_BOX:
          blockEntityTag.setString("id", "shulker_box");
          break;
      }
    }
    TileEntity te = (blockEntityTag == null) ? null : TileEntity.a(null, blockEntityTag);

    switch (material) {
      case SIGN:
      case SIGN_POST:
      case WALL_SIGN:
        if (te == null) {
          te = new TileEntitySign();
        }
        return new CraftSign(material, (TileEntitySign) te);
      case CHEST:
      case TRAPPED_CHEST:
        if (te == null) {
          te = new TileEntityChest();
        }
        return new CraftChest(material, (TileEntityChest) te);
      case BURNING_FURNACE:
      case FURNACE:
        if (te == null) {
          te = new TileEntityFurnace();
        }
        return new CraftFurnace(material, (TileEntityFurnace) te);
      case DISPENSER:
        if (te == null) {
          te = new TileEntityDispenser();
        }
        return new CraftDispenser(material, (TileEntityDispenser) te);
      case DROPPER:
        if (te == null) {
          te = new TileEntityDropper();
        }
        return new CraftDropper(material, (TileEntityDropper) te);
      case END_GATEWAY:
        if (te == null) {
          te = new TileEntityEndGateway();
        }
        return new CraftEndGateway(material, (TileEntityEndGateway) te);
      case HOPPER:
        if (te == null) {
          te = new TileEntityHopper();
        }
        return new CraftHopper(material, (TileEntityHopper) te);
      case MOB_SPAWNER:
        if (te == null) {
          te = new TileEntityMobSpawner();
        }
        return new CraftCreatureSpawner(material, (TileEntityMobSpawner) te);
      case NOTE_BLOCK:
        if (te == null) {
          te = new TileEntityNote();
        }
        return new CraftNoteBlock(material, (TileEntityNote) te);
      case JUKEBOX:
        if (te == null) {
          te = new BlockJukeBox.TileEntityRecordPlayer();
        }
        return new CraftJukebox(material, (BlockJukeBox.TileEntityRecordPlayer) te);
      case BREWING_STAND_ITEM:
        if (te == null) {
          te = new TileEntityBrewingStand();
        }
        return new CraftBrewingStand(material, (TileEntityBrewingStand) te);
      case SKULL:
        if (te == null) {
          te = new TileEntitySkull();
        }
        return new CraftSkull(material, (TileEntitySkull) te);
      case COMMAND:
      case COMMAND_REPEATING:
      case COMMAND_CHAIN:
        if (te == null) {
          te = new TileEntityCommand();
        }
        return new CraftCommandBlock(material, (TileEntityCommand) te);
      case BEACON:
        if (te == null) {
          te = new TileEntityBeacon();
        }
        return new CraftBeacon(material, (TileEntityBeacon) te);
      case SHIELD:
      case BANNER:
      case WALL_BANNER:
      case STANDING_BANNER:
        if (te == null) {
          te = new TileEntityBanner();
        }
        return new CraftBanner(material, (TileEntityBanner) te);
      case FLOWER_POT_ITEM:
        if (te == null) {
          te = new TileEntityFlowerPot();
        }
        return new CraftFlowerPot(material, (TileEntityFlowerPot) te);
      case STRUCTURE_BLOCK:
        if (te == null) {
          te = new TileEntityStructure();
        }
        return new CraftStructureBlock(material, (TileEntityStructure) te);
      case WHITE_SHULKER_BOX:
      case ORANGE_SHULKER_BOX:
      case MAGENTA_SHULKER_BOX:
      case LIGHT_BLUE_SHULKER_BOX:
      case YELLOW_SHULKER_BOX:
      case LIME_SHULKER_BOX:
      case PINK_SHULKER_BOX:
      case GRAY_SHULKER_BOX:
      case SILVER_SHULKER_BOX:
      case CYAN_SHULKER_BOX:
      case PURPLE_SHULKER_BOX:
      case BLUE_SHULKER_BOX:
      case BROWN_SHULKER_BOX:
      case GREEN_SHULKER_BOX:
      case RED_SHULKER_BOX:
      case BLACK_SHULKER_BOX:
        if (te == null) {
          te = new TileEntityShulkerBox();
        }
        return new CraftShulkerBox(material, (TileEntityShulkerBox) te);
      case ENCHANTMENT_TABLE:
        if (te == null) {
          te = new TileEntityEnchantTable();
        }
        return new CraftEnchantingTable(material, (TileEntityEnchantTable) te);
      case ENDER_CHEST:
        if (te == null) {
          te = new TileEntityEnderChest();
        }
        return new CraftEnderChest(material, (TileEntityEnderChest) te);
      case DAYLIGHT_DETECTOR:
      case DAYLIGHT_DETECTOR_INVERTED:
        if (te == null) {
          te = new TileEntityLightDetector();
        }
        return new CraftDaylightDetector(material, (TileEntityLightDetector) te);
      case REDSTONE_COMPARATOR:
        if (te == null) {
          te = new TileEntityComparator();
        }
        return new CraftComparator(material, (TileEntityComparator) te);
      default:
        throw new IllegalStateException("Missing blockState for " + material);
    }
  }
Exemple #11
0
 static {
   a(TileEntityFurnace.class, "Furnace");
   a(TileEntityChest.class, "Chest");
   a(TileEntityEnderChest.class, "EnderChest");
   a(TileEntityRecordPlayer.class, "RecordPlayer");
   a(TileEntityDispenser.class, "Trap");
   a(TileEntityDropper.class, "Dropper");
   a(TileEntitySign.class, "Sign");
   a(TileEntityMobSpawner.class, "MobSpawner");
   a(TileEntityNote.class, "Music");
   a(TileEntityPiston.class, "Piston");
   a(TileEntityBrewingStand.class, "Cauldron");
   a(TileEntityEnchantTable.class, "EnchantTable");
   a(TileEntityEnderPortal.class, "Airportal");
   a(TileEntityCommand.class, "Control");
   a(TileEntityBeacon.class, "Beacon");
   a(TileEntitySkull.class, "Skull");
   a(TileEntityLightDetector.class, "DLDetector");
   a(TileEntityHopper.class, "Hopper");
   a(TileEntityComparator.class, "Comparator");
   a(TileEntityFlowerPot.class, "FlowerPot");
   a(TileEntityBanner.class, "Banner");
 }
  @Override
  public void execute(ICommandListener var1, String[] var2) throws class_bz {
    if (var2.length < 9) {
      throw new class_cf("commands.clone.usage", new Object[0]);
    } else {
      var1.a(class_n.class_a_in_class_n.b, 0);
      class_cj var3 = a(var1, var2, 0, false);
      class_cj var4 = a(var1, var2, 3, false);
      class_cj var5 = a(var1, var2, 6, false);
      class_aua var6 = new class_aua(var3, var4);
      class_aua var7 = new class_aua(var5, var5.a(var6.b()));
      int var8 = var6.c() * var6.d() * var6.e();
      if (var8 > '耀') {
        throw new class_bz(
            "commands.clone.tooManyBlocks",
            new Object[] {Integer.valueOf(var8), Integer.valueOf('耀')});
      } else {
        boolean var9 = false;
        Block var10 = null;
        int var11 = -1;
        if (((var2.length < 11) || (!var2[10].equals("force") && !var2[10].equals("move")))
            && var6.a(var7)) {
          throw new class_bz("commands.clone.noOverlap", new Object[0]);
        } else {
          if ((var2.length >= 11) && var2[10].equals("move")) {
            var9 = true;
          }

          if ((var6.b >= 0) && (var6.e < 256) && (var7.b >= 0) && (var7.e < 256)) {
            class_ago var12 = var1.e();
            if (var12.a(var6) && var12.a(var7)) {
              boolean var13 = false;
              if (var2.length >= 10) {
                if (var2[9].equals("masked")) {
                  var13 = true;
                } else if (var2[9].equals("filtered")) {
                  if (var2.length < 12) {
                    throw new class_cf("commands.clone.usage", new Object[0]);
                  }

                  var10 = g(var1, var2[11]);
                  if (var2.length >= 13) {
                    var11 = a(var2[12], 0, 15);
                  }
                }
              }

              ArrayList var14 = Lists.newArrayList();
              ArrayList var15 = Lists.newArrayList();
              ArrayList var16 = Lists.newArrayList();
              LinkedList var17 = Lists.newLinkedList();
              class_cj var18 = new class_cj(var7.a - var6.a, var7.b - var6.b, var7.c - var6.c);

              for (int var19 = var6.c; var19 <= var6.f; ++var19) {
                for (int var20 = var6.b; var20 <= var6.e; ++var20) {
                  for (int var21 = var6.a; var21 <= var6.d; ++var21) {
                    class_cj var22 = new class_cj(var21, var20, var19);
                    class_cj var23 = var22.a(var18);
                    class_apn var24 = var12.p(var22);
                    if ((!var13 || (var24.c() != Blocks.AIR))
                        && ((var10 == null)
                            || ((var24.c() == var10)
                                && ((var11 < 0) || (var24.c().c(var24) == var11))))) {
                      TileEntity var25 = var12.s(var22);
                      if (var25 != null) {
                        class_dn var26 = new class_dn();
                        var25.b(var26);
                        var15.add(new class_u.class_a_in_class_u(var23, var24, var26));
                        var17.addLast(var22);
                      } else if (!var24.c().q() && !var24.c().d()) {
                        var16.add(new class_u.class_a_in_class_u(var23, var24, (class_dn) null));
                        var17.addFirst(var22);
                      } else {
                        var14.add(new class_u.class_a_in_class_u(var23, var24, (class_dn) null));
                        var17.addLast(var22);
                      }
                    }
                  }
                }
              }

              if (var9) {
                Iterator var27;
                class_cj var29;
                for (var27 = var17.iterator();
                    var27.hasNext();
                    var12.a(var29, Blocks.BARRIER.getBlockData(), 2)) {
                  var29 = (class_cj) var27.next();
                  TileEntity var31 = var12.s(var29);
                  if (var31 instanceof class_pp) {
                    ((class_pp) var31).l();
                  }
                }

                var27 = var17.iterator();

                while (var27.hasNext()) {
                  var29 = (class_cj) var27.next();
                  var12.a(var29, Blocks.AIR.getBlockData(), 3);
                }
              }

              ArrayList var28 = Lists.newArrayList();
              var28.addAll(var14);
              var28.addAll(var15);
              var28.addAll(var16);
              List var30 = Lists.reverse(var28);

              Iterator var32;
              class_u.class_a_in_class_u var33;
              TileEntity var34;
              for (var32 = var30.iterator();
                  var32.hasNext();
                  var12.a(var33.a, Blocks.BARRIER.getBlockData(), 2)) {
                var33 = (class_u.class_a_in_class_u) var32.next();
                var34 = var12.s(var33.a);
                if (var34 instanceof class_pp) {
                  ((class_pp) var34).l();
                }
              }

              var8 = 0;
              var32 = var28.iterator();

              while (var32.hasNext()) {
                var33 = (class_u.class_a_in_class_u) var32.next();
                if (var12.a(var33.a, var33.b, 2)) {
                  ++var8;
                }
              }

              for (var32 = var15.iterator(); var32.hasNext(); var12.a(var33.a, var33.b, 2)) {
                var33 = (class_u.class_a_in_class_u) var32.next();
                var34 = var12.s(var33.a);
                if ((var33.c != null) && (var34 != null)) {
                  var33.c.a("x", var33.a.n());
                  var33.c.a("y", var33.a.o());
                  var33.c.a("z", var33.a.p());
                  var34.a(var33.c);
                  var34.o_();
                }
              }

              var32 = var30.iterator();

              while (var32.hasNext()) {
                var33 = (class_u.class_a_in_class_u) var32.next();
                var12.c(var33.a, var33.b.c());
              }

              List var35 = var12.a(var6, false);
              if (var35 != null) {
                Iterator var36 = var35.iterator();

                while (var36.hasNext()) {
                  class_agz var37 = (class_agz) var36.next();
                  if (var6.b(var37.a)) {
                    class_cj var38 = var37.a.a(var18);
                    var12.b(var38, var37.a(), (int) (var37.b - var12.R().e()), var37.c);
                  }
                }
              }

              if (var8 <= 0) {
                throw new class_bz("commands.clone.failed", new Object[0]);
              } else {
                var1.a(class_n.class_a_in_class_n.b, var8);
                a(var1, this, "commands.clone.success", new Object[] {Integer.valueOf(var8)});
              }
            } else {
              throw new class_bz("commands.clone.outOfWorld", new Object[0]);
            }
          } else {
            throw new class_bz("commands.clone.outOfWorld", new Object[0]);
          }
        }
      }
    }
  }