use the API breaking changes as an occasion to make Schematic function names make more sense

This commit is contained in:
asiekierka 2014-10-26 12:34:07 +01:00
parent 53cfda589e
commit 24b4859178
42 changed files with 142 additions and 142 deletions

View file

@ -150,7 +150,7 @@ public abstract class Schematic {
* y, z} on the world. For blocks, block and meta fields will be initialized
* automatically.
*/
public void writeToBlueprint(IBuilderContext context, int x, int y, int z) {
public void initializeFromObjectAt(IBuilderContext context, int x, int y, int z) {
}
@ -158,14 +158,14 @@ public abstract class Schematic {
* Places the block in the world, at the location specified in the slot,
* using the stack in parameters
*/
public void writeToWorld(IBuilderContext context, int x, int y, int z, LinkedList<ItemStack> stacks) {
public void placeInWorld(IBuilderContext context, int x, int y, int z, LinkedList<ItemStack> stacks) {
}
/**
* Write specific requirements coming from the world to the blueprint.
*/
public void writeRequirementsToBlueprint(IBuilderContext context, int x, int y, int z) {
public void storeRequirements(IBuilderContext context, int x, int y, int z) {
}
@ -174,7 +174,7 @@ public abstract class Schematic {
* requirements are met, they will be removed all at once from the builder,
* before calling writeToWorld.
*/
public void writeRequirementsToWorld(IBuilderContext context, LinkedList<ItemStack> requirements) {
public void getRequirementsForPlacement(IBuilderContext context, LinkedList<ItemStack> requirements) {
}
@ -263,14 +263,14 @@ public abstract class Schematic {
/**
* Saves this schematic to the blueprint NBT.
*/
public void writeToNBT(NBTTagCompound nbt, MappingRegistry registry) {
public void writeSchematicToNBT(NBTTagCompound nbt, MappingRegistry registry) {
}
/**
* Loads this schematic from the blueprint NBT.
*/
public void readFromNBT(NBTTagCompound nbt, MappingRegistry registry) {
public void readSchematicFromNBT(NBTTagCompound nbt, MappingRegistry registry) {
}

View file

@ -34,7 +34,7 @@ public class SchematicBlock extends SchematicBlockBase {
public ItemStack [] storedRequirements = new ItemStack [0];
@Override
public void writeRequirementsToWorld(IBuilderContext context, LinkedList<ItemStack> requirements) {
public void getRequirementsForPlacement(IBuilderContext context, LinkedList<ItemStack> requirements) {
if (block != null) {
if (storedRequirements.length != 0) {
for (ItemStack s : storedRequirements) {
@ -52,15 +52,15 @@ public class SchematicBlock extends SchematicBlockBase {
}
@Override
public void writeToWorld(IBuilderContext context, int x, int y, int z, LinkedList<ItemStack> stacks) {
super.writeToWorld(context, x, y, z, stacks);
public void placeInWorld(IBuilderContext context, int x, int y, int z, LinkedList<ItemStack> stacks) {
super.placeInWorld(context, x, y, z, stacks);
this.setBlockInWorld(context, x, y, z);
}
@Override
public void writeRequirementsToBlueprint(IBuilderContext context, int x, int y, int z) {
super.writeRequirementsToBlueprint(context, x, y, z);
public void storeRequirements(IBuilderContext context, int x, int y, int z) {
super.storeRequirements(context, x, y, z);
if (block != null) {
ArrayList<ItemStack> req = block.getDrops(context.world(), x,
@ -74,16 +74,16 @@ public class SchematicBlock extends SchematicBlockBase {
}
@Override
public void writeToNBT(NBTTagCompound nbt, MappingRegistry registry) {
super.writeToNBT(nbt, registry);
public void writeSchematicToNBT(NBTTagCompound nbt, MappingRegistry registry) {
super.writeSchematicToNBT(nbt, registry);
writeBlockToNBT(nbt, registry);
writeRequirementsToNBT(nbt, registry);
}
@Override
public void readFromNBT(NBTTagCompound nbt, MappingRegistry registry) {
super.readFromNBT(nbt, registry);
public void readSchematicFromNBT(NBTTagCompound nbt, MappingRegistry registry) {
super.readSchematicFromNBT(nbt, registry);
readBlockFromNBT(nbt, registry);
readRequirementsFromNBT(nbt, registry);

View file

@ -42,7 +42,7 @@ public class SchematicEntity extends Schematic {
public ItemStack[] storedRequirements = new ItemStack[0];
@Override
public void writeRequirementsToWorld(IBuilderContext context, LinkedList<ItemStack> requirements) {
public void getRequirementsForPlacement(IBuilderContext context, LinkedList<ItemStack> requirements) {
for (ItemStack s : storedRequirements) {
requirements.add(s);
}
@ -112,8 +112,8 @@ public class SchematicEntity extends Schematic {
}
@Override
public void writeToNBT(NBTTagCompound nbt, MappingRegistry registry) {
super.writeToNBT(nbt, registry);
public void writeSchematicToNBT(NBTTagCompound nbt, MappingRegistry registry) {
super.writeSchematicToNBT(nbt, registry);
NBTTagList nbttaglist = entityNBT.getTagList("Pos", 6);
@ -133,8 +133,8 @@ public class SchematicEntity extends Schematic {
}
@Override
public void readFromNBT(NBTTagCompound nbt, MappingRegistry registry) {
super.readFromNBT(nbt, registry);
public void readSchematicFromNBT(NBTTagCompound nbt, MappingRegistry registry) {
super.readSchematicFromNBT(nbt, registry);
entityNBT = nbt.getCompoundTag("entity");

View file

@ -22,14 +22,14 @@ public class SchematicFluid extends SchematicBlock {
}
@Override
public void writeRequirementsToWorld(IBuilderContext context, LinkedList<ItemStack> requirements) {
public void getRequirementsForPlacement(IBuilderContext context, LinkedList<ItemStack> requirements) {
if (meta == 0) {
requirements.add(fluidItem);
}
}
@Override
public void writeRequirementsToBlueprint(IBuilderContext context, int x, int y, int z) {
public void storeRequirements(IBuilderContext context, int x, int y, int z) {
// cancel requirements reading
}
@ -53,7 +53,7 @@ public class SchematicFluid extends SchematicBlock {
}
@Override
public void writeToWorld(IBuilderContext context, int x, int y, int z, LinkedList<ItemStack> stacks) {
public void placeInWorld(IBuilderContext context, int x, int y, int z, LinkedList<ItemStack> stacks) {
if (meta == 0) {
context.world().setBlock(x, y, z, block, 0, 3);
}

View file

@ -29,7 +29,7 @@ public class SchematicMask extends SchematicBlockBase {
}
@Override
public void writeToWorld(IBuilderContext context, int x, int y, int z, LinkedList<ItemStack> stacks) {
public void placeInWorld(IBuilderContext context, int x, int y, int z, LinkedList<ItemStack> stacks) {
if (isConcrete) {
if (stacks.size() == 0 || !BuildCraftAPI.isSoftBlock(context.world(), x, y, z)) {
return;
@ -59,12 +59,12 @@ public class SchematicMask extends SchematicBlockBase {
}
@Override
public void writeToNBT(NBTTagCompound nbt, MappingRegistry registry) {
public void writeSchematicToNBT(NBTTagCompound nbt, MappingRegistry registry) {
nbt.setBoolean("isConcrete", isConcrete);
}
@Override
public void readFromNBT(NBTTagCompound nbt, MappingRegistry registry) {
public void readSchematicFromNBT(NBTTagCompound nbt, MappingRegistry registry) {
isConcrete = nbt.getBoolean("isConcrete");
}
}

View file

@ -45,8 +45,8 @@ public class SchematicTile extends SchematicBlock {
* Places the block in the world, at the location specified in the slot.
*/
@Override
public void writeToWorld(IBuilderContext context, int x, int y, int z, LinkedList<ItemStack> stacks) {
super.writeToWorld(context, x, y, z, stacks);
public void placeInWorld(IBuilderContext context, int x, int y, int z, LinkedList<ItemStack> stacks) {
super.placeInWorld(context, x, y, z, stacks);
if (block.hasTileEntity(meta)) {
TileEntity tile = context.world().getTileEntity(x, y, z);
@ -62,8 +62,8 @@ public class SchematicTile extends SchematicBlock {
}
@Override
public void writeToBlueprint(IBuilderContext context, int x, int y, int z) {
super.writeToBlueprint(context, x, y, z);
public void initializeFromObjectAt(IBuilderContext context, int x, int y, int z) {
super.initializeFromObjectAt(context, x, y, z);
if (block.hasTileEntity(meta)) {
TileEntity tile = context.world().getTileEntity(x, y, z);
@ -75,8 +75,8 @@ public class SchematicTile extends SchematicBlock {
}
@Override
public void writeRequirementsToBlueprint(IBuilderContext context, int x, int y, int z) {
super.writeRequirementsToBlueprint(context, x, y, z);
public void storeRequirements(IBuilderContext context, int x, int y, int z) {
super.storeRequirements(context, x, y, z);
if (block.hasTileEntity(meta)) {
TileEntity tile = context.world().getTileEntity(x, y, z);
@ -99,15 +99,15 @@ public class SchematicTile extends SchematicBlock {
}
@Override
public void writeToNBT(NBTTagCompound nbt, MappingRegistry registry) {
super.writeToNBT(nbt, registry);
public void writeSchematicToNBT(NBTTagCompound nbt, MappingRegistry registry) {
super.writeSchematicToNBT(nbt, registry);
nbt.setTag("blockCpt", tileNBT);
}
@Override
public void readFromNBT(NBTTagCompound nbt, MappingRegistry registry) {
super.readFromNBT(nbt, registry);
public void readSchematicFromNBT(NBTTagCompound nbt, MappingRegistry registry) {
super.readSchematicFromNBT(nbt, registry);
tileNBT = nbt.getCompoundTag("blockCpt");
}

View file

@ -19,14 +19,14 @@ import buildcraft.api.blueprints.SchematicBlock;
public class SchematicBed extends SchematicBlock {
@Override
public void writeRequirementsToWorld(IBuilderContext context, LinkedList<ItemStack> requirements) {
public void getRequirementsForPlacement(IBuilderContext context, LinkedList<ItemStack> requirements) {
if ((meta & 8) == 0) {
requirements.add(new ItemStack(Items.bed));
}
}
@Override
public void writeRequirementsToBlueprint(IBuilderContext context, int x, int y, int z) {
public void storeRequirements(IBuilderContext context, int x, int y, int z) {
// cancel requirements reading
}
@ -52,7 +52,7 @@ public class SchematicBed extends SchematicBlock {
}
@Override
public void writeToWorld(IBuilderContext context, int x, int y, int z, LinkedList<ItemStack> stacks) {
public void placeInWorld(IBuilderContext context, int x, int y, int z, LinkedList<ItemStack> stacks) {
if ((meta & 8) != 0) {
return;
}

View file

@ -19,17 +19,17 @@ import buildcraft.api.blueprints.SchematicBlock;
public class SchematicCactus extends SchematicBlock {
@Override
public void writeRequirementsToWorld(IBuilderContext context, LinkedList<ItemStack> requirements) {
public void getRequirementsForPlacement(IBuilderContext context, LinkedList<ItemStack> requirements) {
requirements.add(new ItemStack(Blocks.cactus));
}
@Override
public void writeRequirementsToBlueprint(IBuilderContext context, int x, int y, int z) {
public void storeRequirements(IBuilderContext context, int x, int y, int z) {
// cancel requirements reading
}
@Override
public void writeToWorld(IBuilderContext context, int x, int y, int z, LinkedList<ItemStack> stacks) {
public void placeInWorld(IBuilderContext context, int x, int y, int z, LinkedList<ItemStack> stacks) {
context.world().setBlock(x, y, z, Blocks.cactus, 0, 3);
}

View file

@ -24,12 +24,12 @@ public class SchematicCustomStack extends SchematicBlock {
}
@Override
public void writeRequirementsToWorld(IBuilderContext context, LinkedList<ItemStack> requirements) {
public void getRequirementsForPlacement(IBuilderContext context, LinkedList<ItemStack> requirements) {
requirements.add(customStack.copy());
}
@Override
public void writeRequirementsToBlueprint(IBuilderContext context, int x, int y, int z) {
public void storeRequirements(IBuilderContext context, int x, int y, int z) {
// cancel requirements reading
}
}

View file

@ -20,17 +20,17 @@ import buildcraft.api.blueprints.SchematicBlock;
public class SchematicDirt extends SchematicBlock {
@Override
public void writeRequirementsToWorld(IBuilderContext context, LinkedList<ItemStack> requirements) {
public void getRequirementsForPlacement(IBuilderContext context, LinkedList<ItemStack> requirements) {
requirements.add(new ItemStack(Blocks.dirt));
}
@Override
public void writeRequirementsToBlueprint(IBuilderContext context, int x, int y, int z) {
public void storeRequirements(IBuilderContext context, int x, int y, int z) {
// cancel requirements reading
}
@Override
public void writeToWorld(IBuilderContext context, int x, int y, int z, LinkedList<ItemStack> stacks) {
public void placeInWorld(IBuilderContext context, int x, int y, int z, LinkedList<ItemStack> stacks) {
context.world().setBlock(x, y, z, Blocks.dirt, meta, 3);
}

View file

@ -27,14 +27,14 @@ public class SchematicDoor extends SchematicBlock {
}
@Override
public void writeRequirementsToWorld(IBuilderContext context, LinkedList<ItemStack> requirements) {
public void getRequirementsForPlacement(IBuilderContext context, LinkedList<ItemStack> requirements) {
if ((meta & 8) == 0) {
requirements.add(stack.copy());
}
}
@Override
public void writeRequirementsToBlueprint(IBuilderContext context, int x, int y, int z) {
public void storeRequirements(IBuilderContext context, int x, int y, int z) {
// cancel requirements reading
}
@ -72,7 +72,7 @@ public class SchematicDoor extends SchematicBlock {
}
@Override
public void writeToWorld(IBuilderContext context, int x, int y, int z, LinkedList<ItemStack> stacks) {
public void placeInWorld(IBuilderContext context, int x, int y, int z, LinkedList<ItemStack> stacks) {
context.world().setBlock(x, y, z, block, meta, 3);
context.world().setBlock(x, y + 1, z, block, upperMeta, 3);
@ -81,8 +81,8 @@ public class SchematicDoor extends SchematicBlock {
}
@Override
public void writeToBlueprint(IBuilderContext context, int x, int y, int z) {
super.writeToBlueprint(context, x, y, z);
public void initializeFromObjectAt(IBuilderContext context, int x, int y, int z) {
super.initializeFromObjectAt(context, x, y, z);
if ((meta & 8) == 0) {
upperMeta = context.world().getBlockMetadata(x, y + 1, z);
@ -90,15 +90,15 @@ public class SchematicDoor extends SchematicBlock {
}
@Override
public void writeToNBT(NBTTagCompound nbt, MappingRegistry registry) {
super.writeToNBT(nbt, registry);
public void writeSchematicToNBT(NBTTagCompound nbt, MappingRegistry registry) {
super.writeSchematicToNBT(nbt, registry);
nbt.setByte("upperMeta", (byte) upperMeta);
}
@Override
public void readFromNBT(NBTTagCompound nbt, MappingRegistry registry) {
super.readFromNBT(nbt, registry);
public void readSchematicFromNBT(NBTTagCompound nbt, MappingRegistry registry) {
super.readSchematicFromNBT(nbt, registry);
upperMeta = nbt.getByte("upperMeta");
}

View file

@ -23,13 +23,13 @@ public class SchematicEnderChest extends SchematicRotateMeta {
}
@Override
public void writeRequirementsToWorld(IBuilderContext context, LinkedList<ItemStack> requirements) {
public void getRequirementsForPlacement(IBuilderContext context, LinkedList<ItemStack> requirements) {
requirements.add(new ItemStack(Blocks.obsidian, 8));
requirements.add(new ItemStack(Items.ender_eye, 1));
}
@Override
public void writeRequirementsToBlueprint(IBuilderContext context, int x, int y, int z) {
public void storeRequirements(IBuilderContext context, int x, int y, int z) {
// cancel requirements reading
}

View file

@ -35,7 +35,7 @@ public class SchematicFactoryBlock extends SchematicFactory<SchematicBlock> {
SchematicBlock s = SchematicRegistry.INSTANCE.createSchematicBlock(b, nbt.getInteger("blockMeta"));
if (s != null) {
s.readFromNBT(nbt, registry);
s.readSchematicFromNBT(nbt, registry);
return s;
}
}
@ -48,7 +48,7 @@ public class SchematicFactoryBlock extends SchematicFactory<SchematicBlock> {
super.saveSchematicToWorldNBT(nbt, object, registry);
nbt.setInteger("blockId", registry.getIdForBlock(object.block));
object.writeToNBT(nbt, registry);
object.writeSchematicToNBT(nbt, registry);
}
}

View file

@ -24,7 +24,7 @@ public class SchematicFactoryEntity extends SchematicFactory<SchematicEntity> {
SchematicEntity s = SchematicRegistry.INSTANCE.createSchematicEntity(registry.getEntityForId(entityId));
if (s != null) {
s.readFromNBT(nbt, registry);
s.readSchematicFromNBT(nbt, registry);
} else {
return null;
}
@ -37,7 +37,7 @@ public class SchematicFactoryEntity extends SchematicFactory<SchematicEntity> {
super.saveSchematicToWorldNBT(nbt, object, registry);
nbt.setInteger("entityId", registry.getIdForEntity(object.entity));
object.writeToNBT(nbt, registry);
object.writeSchematicToNBT(nbt, registry);
}
}

View file

@ -18,7 +18,7 @@ public class SchematicFactoryMask extends SchematicFactory<SchematicMask> {
@Override
protected SchematicMask loadSchematicFromWorldNBT (NBTTagCompound nbt, MappingRegistry registry) {
SchematicMask s = new SchematicMask();
s.readFromNBT(nbt, registry);
s.readSchematicFromNBT(nbt, registry);
return s;
}
@ -27,7 +27,7 @@ public class SchematicFactoryMask extends SchematicFactory<SchematicMask> {
public void saveSchematicToWorldNBT (NBTTagCompound nbt, SchematicMask object, MappingRegistry registry) {
super.saveSchematicToWorldNBT(nbt, object, registry);
object.writeToNBT(nbt, registry);
object.writeSchematicToNBT(nbt, registry);
}
}

View file

@ -20,17 +20,17 @@ import buildcraft.api.blueprints.SchematicBlock;
public class SchematicFarmland extends SchematicBlock {
@Override
public void writeRequirementsToWorld(IBuilderContext context, LinkedList<ItemStack> requirements) {
public void getRequirementsForPlacement(IBuilderContext context, LinkedList<ItemStack> requirements) {
requirements.add(new ItemStack(Blocks.dirt));
}
@Override
public void writeRequirementsToBlueprint(IBuilderContext context, int x, int y, int z) {
public void storeRequirements(IBuilderContext context, int x, int y, int z) {
// cancel requirements reading
}
@Override
public void writeToWorld(IBuilderContext context, int x, int y, int z, LinkedList<ItemStack> stacks) {
public void placeInWorld(IBuilderContext context, int x, int y, int z, LinkedList<ItemStack> stacks) {
context.world().setBlock(x, y, z, block, 0, 3);
}

View file

@ -19,12 +19,12 @@ import buildcraft.api.blueprints.SchematicBlock;
public class SchematicFire extends SchematicBlock {
@Override
public void writeRequirementsToWorld(IBuilderContext context, LinkedList<ItemStack> requirements) {
public void getRequirementsForPlacement(IBuilderContext context, LinkedList<ItemStack> requirements) {
requirements.add(new ItemStack (Items.flint_and_steel));
}
@Override
public void writeRequirementsToBlueprint(IBuilderContext context, int x, int y, int z) {
public void storeRequirements(IBuilderContext context, int x, int y, int z) {
// cancel requirements reading
}
}

View file

@ -18,12 +18,12 @@ import buildcraft.api.blueprints.SchematicBlock;
public class SchematicGlassPane extends SchematicBlock {
@Override
public void writeRequirementsToWorld(IBuilderContext context, LinkedList<ItemStack> requirements) {
public void getRequirementsForPlacement(IBuilderContext context, LinkedList<ItemStack> requirements) {
requirements.add(new ItemStack(block, 1, 0));
}
@Override
public void writeRequirementsToBlueprint(IBuilderContext context, int x, int y, int z) {
public void storeRequirements(IBuilderContext context, int x, int y, int z) {
}

View file

@ -20,17 +20,17 @@ import buildcraft.api.blueprints.SchematicBlock;
public class SchematicGravel extends SchematicBlock {
@Override
public void writeRequirementsToWorld(IBuilderContext context, LinkedList<ItemStack> requirements) {
public void getRequirementsForPlacement(IBuilderContext context, LinkedList<ItemStack> requirements) {
requirements.add(new ItemStack(Blocks.gravel));
}
@Override
public void writeRequirementsToBlueprint(IBuilderContext context, int x, int y, int z) {
public void storeRequirements(IBuilderContext context, int x, int y, int z) {
// cancel requirements reading
}
@Override
public void writeToWorld(IBuilderContext context, int x, int y, int z, LinkedList<ItemStack> stacks) {
public void placeInWorld(IBuilderContext context, int x, int y, int z, LinkedList<ItemStack> stacks) {
context.world().setBlock(x, y, z, Blocks.gravel, 0, 3);
}

View file

@ -18,7 +18,7 @@ import buildcraft.api.blueprints.SchematicBlock;
public class SchematicIgnore extends SchematicBlock {
@Override
public void writeRequirementsToWorld(IBuilderContext context, LinkedList<ItemStack> requirements) {
public void getRequirementsForPlacement(IBuilderContext context, LinkedList<ItemStack> requirements) {
}
@ -28,17 +28,17 @@ public class SchematicIgnore extends SchematicBlock {
}
@Override
public void writeToBlueprint(IBuilderContext context, int x, int y, int z) {
public void initializeFromObjectAt(IBuilderContext context, int x, int y, int z) {
}
@Override
public void writeToWorld(IBuilderContext context, int x, int y, int z, LinkedList<ItemStack> stacks) {
public void placeInWorld(IBuilderContext context, int x, int y, int z, LinkedList<ItemStack> stacks) {
}
@Override
public void writeRequirementsToBlueprint(IBuilderContext context, int x, int y, int z) {
public void storeRequirements(IBuilderContext context, int x, int y, int z) {
}

View file

@ -18,12 +18,12 @@ import buildcraft.api.blueprints.SchematicBlock;
public class SchematicIgnoreMeta extends SchematicBlock {
@Override
public void writeRequirementsToWorld(IBuilderContext context, LinkedList<ItemStack> requirements) {
public void getRequirementsForPlacement(IBuilderContext context, LinkedList<ItemStack> requirements) {
requirements.add(new ItemStack(block, 1, 0));
}
@Override
public void writeRequirementsToBlueprint(IBuilderContext context, int x, int y, int z) {
public void storeRequirements(IBuilderContext context, int x, int y, int z) {
}

View file

@ -21,7 +21,7 @@ public class SchematicPiston extends SchematicRotateMeta {
}
@Override
public void writeToWorld(IBuilderContext context, int x, int y, int z, LinkedList<ItemStack> stacks) {
public void placeInWorld(IBuilderContext context, int x, int y, int z, LinkedList<ItemStack> stacks) {
int localMeta = meta & 7;
context.world().setBlock(x, y, z, block, localMeta, 3);

View file

@ -19,17 +19,17 @@ import buildcraft.api.blueprints.SchematicBlock;
public class SchematicPortal extends SchematicBlock {
@Override
public void writeRequirementsToWorld(IBuilderContext context, LinkedList<ItemStack> requirements) {
public void getRequirementsForPlacement(IBuilderContext context, LinkedList<ItemStack> requirements) {
}
@Override
public void writeRequirementsToBlueprint(IBuilderContext context, int x, int y, int z) {
public void storeRequirements(IBuilderContext context, int x, int y, int z) {
}
@Override
public void writeToWorld(IBuilderContext context, int x, int y, int z, LinkedList<ItemStack> stacks) {
public void placeInWorld(IBuilderContext context, int x, int y, int z, LinkedList<ItemStack> stacks) {
}
@Override

View file

@ -18,12 +18,12 @@ import buildcraft.api.blueprints.SchematicBlock;
public class SchematicPumpkin extends SchematicBlock {
@Override
public void writeRequirementsToWorld(IBuilderContext context, LinkedList<ItemStack> requirements) {
public void getRequirementsForPlacement(IBuilderContext context, LinkedList<ItemStack> requirements) {
requirements.add(new ItemStack(block, 1, 0));
}
@Override
public void writeRequirementsToBlueprint(IBuilderContext context, int x, int y, int z) {
public void storeRequirements(IBuilderContext context, int x, int y, int z) {
// cancel requirements reading
}

View file

@ -56,7 +56,7 @@ public class SchematicRail extends SchematicBlock {
}
@Override
public void writeToWorld(IBuilderContext context, int x, int y, int z, LinkedList<ItemStack> stacks) {
public void placeInWorld(IBuilderContext context, int x, int y, int z, LinkedList<ItemStack> stacks) {
context.world().setBlock(x, y, z, block, 0, 3);
}

View file

@ -24,12 +24,12 @@ public class SchematicRedstoneDiode extends SchematicBlock {
}
@Override
public void writeRequirementsToWorld(IBuilderContext context, LinkedList<ItemStack> requirements) {
public void getRequirementsForPlacement(IBuilderContext context, LinkedList<ItemStack> requirements) {
requirements.add(new ItemStack(baseItem));
}
@Override
public void writeRequirementsToBlueprint(IBuilderContext context, int x, int y, int z) {
public void storeRequirements(IBuilderContext context, int x, int y, int z) {
}

View file

@ -20,12 +20,12 @@ import buildcraft.api.blueprints.SchematicBlock;
public class SchematicRedstoneLamp extends SchematicBlock {
@Override
public void writeRequirementsToWorld(IBuilderContext context, LinkedList<ItemStack> requirements) {
public void getRequirementsForPlacement(IBuilderContext context, LinkedList<ItemStack> requirements) {
requirements.add(new ItemStack(Blocks.redstone_lamp, 1, 0));
}
@Override
public void writeRequirementsToBlueprint(IBuilderContext context, int x, int y, int z) {
public void storeRequirements(IBuilderContext context, int x, int y, int z) {
}

View file

@ -24,17 +24,17 @@ public class SchematicRedstoneWire extends SchematicBlock {
}
@Override
public void writeRequirementsToWorld(IBuilderContext context, LinkedList<ItemStack> requirements) {
public void getRequirementsForPlacement(IBuilderContext context, LinkedList<ItemStack> requirements) {
requirements.add(customStack.copy());
}
@Override
public void writeRequirementsToBlueprint(IBuilderContext context, int x, int y, int z) {
public void storeRequirements(IBuilderContext context, int x, int y, int z) {
}
@Override
public void writeToWorld(IBuilderContext context, int x, int y, int z, LinkedList<ItemStack> stacks) {
public void placeInWorld(IBuilderContext context, int x, int y, int z, LinkedList<ItemStack> stacks) {
context.world().setBlock(x, y, z, block, 0, 3);
}

View file

@ -25,17 +25,17 @@ public class SchematicSeeds extends SchematicBlock {
}
@Override
public void writeRequirementsToWorld(IBuilderContext context, LinkedList<ItemStack> requirements) {
public void getRequirementsForPlacement(IBuilderContext context, LinkedList<ItemStack> requirements) {
requirements.add(new ItemStack(seeds));
}
@Override
public void writeRequirementsToBlueprint(IBuilderContext context, int x, int y, int z) {
public void storeRequirements(IBuilderContext context, int x, int y, int z) {
}
@Override
public void writeToWorld(IBuilderContext context, int x, int y, int z, LinkedList<ItemStack> stacks) {
public void placeInWorld(IBuilderContext context, int x, int y, int z, LinkedList<ItemStack> stacks) {
context.world().setBlock(x, y, z, block, 0, 3);
}

View file

@ -27,12 +27,12 @@ public class SchematicSign extends SchematicTile {
}
@Override
public void writeRequirementsToWorld(IBuilderContext context, LinkedList<ItemStack> requirements) {
public void getRequirementsForPlacement(IBuilderContext context, LinkedList<ItemStack> requirements) {
requirements.add(new ItemStack(Items.sign));
}
@Override
public void writeRequirementsToBlueprint(IBuilderContext context, int x, int y, int z) {
public void storeRequirements(IBuilderContext context, int x, int y, int z) {
// cancel requirements reading
}

View file

@ -18,12 +18,12 @@ import buildcraft.api.blueprints.SchematicBlock;
public class SchematicStairs extends SchematicBlock {
@Override
public void writeRequirementsToWorld(IBuilderContext context, LinkedList<ItemStack> requirements) {
public void getRequirementsForPlacement(IBuilderContext context, LinkedList<ItemStack> requirements) {
requirements.add(new ItemStack(block, 1, 0));
}
@Override
public void writeRequirementsToBlueprint(IBuilderContext context, int x, int y, int z) {
public void storeRequirements(IBuilderContext context, int x, int y, int z) {
}

View file

@ -20,17 +20,17 @@ import buildcraft.api.blueprints.SchematicBlock;
public class SchematicStone extends SchematicBlock {
@Override
public void writeRequirementsToWorld(IBuilderContext context, LinkedList<ItemStack> requirements) {
public void getRequirementsForPlacement(IBuilderContext context, LinkedList<ItemStack> requirements) {
requirements.add(new ItemStack(Blocks.stone));
}
@Override
public void writeRequirementsToBlueprint(IBuilderContext context, int x, int y, int z) {
public void storeRequirements(IBuilderContext context, int x, int y, int z) {
}
@Override
public void writeToWorld(IBuilderContext context, int x, int y, int z, LinkedList<ItemStack> stacks) {
public void placeInWorld(IBuilderContext context, int x, int y, int z, LinkedList<ItemStack> stacks) {
context.world().setBlock(x, y, z, Blocks.stone, 0, 3);
}

View file

@ -41,7 +41,7 @@ public class SchematicTripWireHook extends SchematicBlock {
}
@Override
public void writeToWorld(IBuilderContext context, int x, int y, int z, LinkedList<ItemStack> stacks) {
public void placeInWorld(IBuilderContext context, int x, int y, int z, LinkedList<ItemStack> stacks) {
context.world().setBlock(x, y, z, block, meta, 3);
}

View file

@ -101,8 +101,8 @@ public class Blueprint extends BlueprintBase {
}
try {
slot.writeToBlueprint(context, x, y, z);
slot.writeRequirementsToBlueprint(context, x, y, z);
slot.initializeFromObjectAt(context, x, y, z);
slot.storeRequirements(context, x, y, z);
contents[posX][posY][posZ] = slot;
} catch (Throwable t) {
// Defensive code against errors in implementers
@ -158,7 +158,7 @@ public class Blueprint extends BlueprintBase {
if (contents [x][y][z] != null) {
contents[x][y][z].idsToBlueprint(mapping);
contents[x][y][z].writeToNBT(cpt, mapping);
contents[x][y][z].writeSchematicToNBT(cpt, mapping);
}
nbtContents.appendTag(cpt);
@ -173,7 +173,7 @@ public class Blueprint extends BlueprintBase {
for (SchematicEntity s : entities) {
NBTTagCompound subNBT = new NBTTagCompound();
s.idsToBlueprint(mapping);
s.writeToNBT(subNBT, mapping);
s.writeSchematicToNBT(subNBT, mapping);
entitiesNBT.appendTag(subNBT);
}
@ -211,7 +211,7 @@ public class Blueprint extends BlueprintBase {
if (block != null) {
contents[x][y][z] = SchematicRegistry.INSTANCE.createSchematicBlock(block, cpt.getInteger("blockMeta"));
contents[x][y][z].readFromNBT(cpt, mapping);
contents[x][y][z].readSchematicFromNBT(cpt, mapping);
if (!contents[x][y][z].doNotUse()) {
contents[x][y][z].idsToWorld(mapping);
@ -261,7 +261,7 @@ public class Blueprint extends BlueprintBase {
if (entity != null) {
SchematicEntity s = SchematicRegistry.INSTANCE.createSchematicEntity(entity);
s.readFromNBT(cpt, mapping);
s.readSchematicFromNBT(cpt, mapping);
s.idsToWorld(mapping);
entities.add(s);
} else {

View file

@ -457,7 +457,7 @@ public class BptBuilderBlueprint extends BptBuilderBase {
try {
LinkedList<ItemStack> req = new LinkedList<ItemStack>();
slot.writeRequirementsToWorld(context, req);
slot.getRequirementsForPlacement(context, req);
for (ItemStack stk : req) {
if (stk != null) {

View file

@ -53,7 +53,7 @@ public class BuildingSlotBlock extends BuildingSlot {
}
} else {
try {
getSchematic().writeToWorld(context, x, y, z, stackConsumed);
getSchematic().placeInWorld(context, x, y, z, stackConsumed);
// Once the schematic has been written, we're going to issue
// calls
@ -86,7 +86,7 @@ public class BuildingSlotBlock extends BuildingSlot {
} else {
LinkedList<ItemStack> req = new LinkedList<ItemStack>();
getSchematic().writeRequirementsToWorld(context, req);
getSchematic().getRequirementsForPlacement(context, req);
return req;
}

View file

@ -29,8 +29,8 @@ public class SchematicEngine extends SchematicTile {
}
@Override
public void writeToBlueprint(IBuilderContext context, int x, int y, int z) {
super.writeToBlueprint(context, x, y, z);
public void initializeFromObjectAt(IBuilderContext context, int x, int y, int z) {
super.initializeFromObjectAt(context, x, y, z);
TileEngine engine = (TileEngine) context.world().getTileEntity(x, y, z);
@ -43,8 +43,8 @@ public class SchematicEngine extends SchematicTile {
}
@Override
public void writeToWorld(IBuilderContext context, int x, int y, int z, LinkedList<ItemStack> stacks) {
super.writeToWorld(context, x, y, z, stacks);
public void placeInWorld(IBuilderContext context, int x, int y, int z, LinkedList<ItemStack> stacks) {
super.placeInWorld(context, x, y, z, stacks);
TileEngine engine = (TileEngine) context.world().getTileEntity(x, y, z);

View file

@ -19,25 +19,25 @@ import buildcraft.api.blueprints.SchematicTile;
public class SchematicPump extends SchematicTile {
@Override
public void writeRequirementsToWorld(IBuilderContext context, LinkedList<ItemStack> requirements) {
public void getRequirementsForPlacement(IBuilderContext context, LinkedList<ItemStack> requirements) {
requirements.add(new ItemStack(BuildCraftFactory.pumpBlock));
}
@Override
public void writeRequirementsToBlueprint(IBuilderContext context, int x, int y, int z) {
public void storeRequirements(IBuilderContext context, int x, int y, int z) {
}
@Override
public void writeToBlueprint(IBuilderContext context, int x, int y, int z) {
super.writeToBlueprint(context, x, y, z);
public void initializeFromObjectAt(IBuilderContext context, int x, int y, int z) {
super.initializeFromObjectAt(context, x, y, z);
tileNBT.removeTag("tank");
tileNBT.removeTag("mjStored");
}
@Override
public void writeToWorld(IBuilderContext context, int x, int y, int z, LinkedList<ItemStack> stacks) {
public void placeInWorld(IBuilderContext context, int x, int y, int z, LinkedList<ItemStack> stacks) {
context.world().setBlock(x, y, z, block, 0, 3);
}

View file

@ -21,12 +21,12 @@ import buildcraft.api.blueprints.SchematicTile;
public class SchematicRefinery extends SchematicTile {
@Override
public void writeRequirementsToWorld(IBuilderContext context, LinkedList<ItemStack> requirements) {
public void getRequirementsForPlacement(IBuilderContext context, LinkedList<ItemStack> requirements) {
requirements.add(new ItemStack(BuildCraftFactory.refineryBlock));
}
@Override
public void writeRequirementsToBlueprint(IBuilderContext context, int x, int y, int z) {
public void storeRequirements(IBuilderContext context, int x, int y, int z) {
}
@ -36,8 +36,8 @@ public class SchematicRefinery extends SchematicTile {
}
@Override
public void writeToBlueprint(IBuilderContext context, int x, int y, int z) {
super.writeToBlueprint(context, x, y, z);
public void initializeFromObjectAt(IBuilderContext context, int x, int y, int z) {
super.initializeFromObjectAt(context, x, y, z);
tileNBT.removeTag("tank1");
tileNBT.removeTag("tank2");
@ -46,14 +46,14 @@ public class SchematicRefinery extends SchematicTile {
}
@Override
public void writeToWorld(IBuilderContext context, int x, int y, int z, LinkedList<ItemStack> stacks) {
public void placeInWorld(IBuilderContext context, int x, int y, int z, LinkedList<ItemStack> stacks) {
// to support refineries coming from older blueprints
tileNBT.removeTag("tank1");
tileNBT.removeTag("tank2");
tileNBT.removeTag("result");
tileNBT.removeTag("mjStored");
super.writeToWorld(context, x, y, z, stacks);
super.placeInWorld(context, x, y, z, stacks);
}
}

View file

@ -18,22 +18,22 @@ import buildcraft.api.blueprints.SchematicTile;
public class SchematicTank extends SchematicTile {
@Override
public void writeRequirementsToWorld(IBuilderContext context, LinkedList<ItemStack> requirements) {
public void getRequirementsForPlacement(IBuilderContext context, LinkedList<ItemStack> requirements) {
requirements.add(new ItemStack(block));
}
@Override
public void writeRequirementsToBlueprint(IBuilderContext context, int x, int y, int z) {
public void storeRequirements(IBuilderContext context, int x, int y, int z) {
}
@Override
public void writeToBlueprint(IBuilderContext context, int x, int y, int z) {
public void initializeFromObjectAt(IBuilderContext context, int x, int y, int z) {
}
@Override
public void writeToWorld(IBuilderContext context, int x, int y, int z, LinkedList<ItemStack> stacks) {
public void placeInWorld(IBuilderContext context, int x, int y, int z, LinkedList<ItemStack> stacks) {
context.world().setBlock(x, y, z, block, meta, 3);
}

View file

@ -14,8 +14,8 @@ import buildcraft.api.blueprints.SchematicTile;
public class SchematicLaserTableBase extends SchematicTile {
@Override
public void writeToBlueprint(IBuilderContext context, int x, int y, int z) {
super.writeToBlueprint(context, x, y, z);
public void initializeFromObjectAt(IBuilderContext context, int x, int y, int z) {
super.initializeFromObjectAt(context, x, y, z);
tileNBT.removeTag("energy");
}

View file

@ -110,7 +110,7 @@ public class SchematicPipe extends SchematicTile {
}
@Override
public void writeToWorld(IBuilderContext context, int x, int y, int z, LinkedList<ItemStack> stacks) {
public void placeInWorld(IBuilderContext context, int x, int y, int z, LinkedList<ItemStack> stacks) {
tileNBT.setInteger("x", x);
tileNBT.setInteger("y", y);
tileNBT.setInteger("z", z);
@ -122,7 +122,7 @@ public class SchematicPipe extends SchematicTile {
}
@Override
public void writeToBlueprint(IBuilderContext context, int x, int y, int z) {
public void initializeFromObjectAt(IBuilderContext context, int x, int y, int z) {
TileEntity tile = context.world().getTileEntity(x, y, z);
Pipe<?> pipe = BlockGenericPipe.getPipe(context.world(), x, y, z);
@ -148,7 +148,7 @@ public class SchematicPipe extends SchematicTile {
}
@Override
public void writeRequirementsToBlueprint(IBuilderContext context, int x, int y, int z) {
public void storeRequirements(IBuilderContext context, int x, int y, int z) {
Pipe<?> pipe = BlockGenericPipe.getPipe(context.world(), x, y, z);
if (BlockGenericPipe.isValid(pipe)) {
@ -201,14 +201,14 @@ public class SchematicPipe extends SchematicTile {
}
@Override
public void writeToNBT(NBTTagCompound nbt, MappingRegistry registry) {
super.writeToNBT(nbt, registry);
public void writeSchematicToNBT(NBTTagCompound nbt, MappingRegistry registry) {
super.writeSchematicToNBT(nbt, registry);
nbt.setInteger("version", 2);
}
@Override
public void readFromNBT(NBTTagCompound nbt, MappingRegistry registry) {
super.readFromNBT(nbt, registry);
public void readSchematicFromNBT(NBTTagCompound nbt, MappingRegistry registry) {
super.readSchematicFromNBT(nbt, registry);
if (!nbt.hasKey("version") || nbt.getInteger("version") < 2) {
// Schematics previous to the fixes in version 2 had item id