Esempio n. 1
0
  @Override
  public void writeToNBT(NBTTagCompound nbt, MappingRegistry registry) {
    nbt.setByte("mode", (byte) mode.ordinal());
    nbt.setInteger("x", x);
    nbt.setInteger("y", y);
    nbt.setInteger("z", z);

    if (schematic != null) {
      NBTTagCompound schematicNBT = new NBTTagCompound();
      SchematicFactory.getFactory(schematic.getClass())
          .saveSchematicToWorldNBT(schematicNBT, schematic, registry);
      nbt.setTag("schematic", schematicNBT);
    }

    NBTTagList nbtStacks = new NBTTagList();

    if (stackConsumed != null) {
      for (ItemStack stack : stackConsumed) {
        NBTTagCompound nbtStack = new NBTTagCompound();
        stack.writeToNBT(nbtStack);
        nbtStacks.appendTag(nbtStack);
      }
    }

    nbt.setTag("stackConsumed", nbtStacks);
  }
Esempio n. 2
0
 @Override
 public int buildTime() {
   if (schematic == null) {
     return 1;
   } else {
     return schematic.buildTime();
   }
 }
Esempio n. 3
0
 @Override
 public int getEnergyRequirement() {
   return schematic.getEnergyRequirement(stackConsumed);
 }
Esempio n. 4
0
 @Override
 public boolean isAlreadyBuilt(IBuilderContext context) {
   return schematic.isAlreadyBuilt(context, x, y, z);
 }