diff --git a/common/buildcraft/BuildCraftBuilders.java b/common/buildcraft/BuildCraftBuilders.java index 25720c21..494be8ae 100644 --- a/common/buildcraft/BuildCraftBuilders.java +++ b/common/buildcraft/BuildCraftBuilders.java @@ -18,26 +18,26 @@ import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.common.config.Configuration; import net.minecraftforge.common.config.Property; import buildcraft.api.blueprints.BlueprintManager; -import buildcraft.api.bptblocks.BptBlockBed; -import buildcraft.api.bptblocks.BptBlockCustomStack; -import buildcraft.api.bptblocks.BptBlockDirt; -import buildcraft.api.bptblocks.BptBlockDoor; -import buildcraft.api.bptblocks.BptBlockFluid; -import buildcraft.api.bptblocks.BptBlockIgnore; -import buildcraft.api.bptblocks.BptBlockIgnoreMeta; -import buildcraft.api.bptblocks.BptBlockInventory; -import buildcraft.api.bptblocks.BptBlockLever; -import buildcraft.api.bptblocks.BptBlockPiston; -import buildcraft.api.bptblocks.BptBlockPumpkin; -import buildcraft.api.bptblocks.BptBlockRedstoneRepeater; -import buildcraft.api.bptblocks.BptBlockRotateInventory; -import buildcraft.api.bptblocks.BptBlockRotateMeta; -import buildcraft.api.bptblocks.BptBlockSign; -import buildcraft.api.bptblocks.BptBlockStairs; -import buildcraft.api.bptblocks.BptBlockWallSide; import buildcraft.api.filler.FillerManager; import buildcraft.api.filler.IFillerPattern; import buildcraft.api.gates.ActionManager; +import buildcraft.api.schematics.SchematicBed; +import buildcraft.api.schematics.SchematicCustomStack; +import buildcraft.api.schematics.SchematicDirt; +import buildcraft.api.schematics.SchematicDoor; +import buildcraft.api.schematics.SchematicFluid; +import buildcraft.api.schematics.SchematicIgnore; +import buildcraft.api.schematics.SchematicIgnoreMeta; +import buildcraft.api.schematics.SchematicInventory; +import buildcraft.api.schematics.SchematicLever; +import buildcraft.api.schematics.SchematicPiston; +import buildcraft.api.schematics.SchematicPumpkin; +import buildcraft.api.schematics.SchematicRedstoneRepeater; +import buildcraft.api.schematics.SchematicRotateInventory; +import buildcraft.api.schematics.SchematicRotateMeta; +import buildcraft.api.schematics.SchematicSign; +import buildcraft.api.schematics.SchematicStairs; +import buildcraft.api.schematics.SchematicWallSide; import buildcraft.builders.BlockArchitect; import buildcraft.builders.BlockBlueprintLibrary; import buildcraft.builders.BlockBuilder; @@ -141,85 +141,85 @@ public class BuildCraftBuilders extends BuildCraftMod { // Register save handler MinecraftForge.EVENT_BUS.register(new EventHandlerBuilders()); - BlueprintManager.registerSchematicClass(Blocks.snow, BptBlockIgnore.class); - BlueprintManager.registerSchematicClass(Blocks.tallgrass, BptBlockIgnore.class); - BlueprintManager.registerSchematicClass(Blocks.ice, BptBlockIgnore.class); - BlueprintManager.registerSchematicClass(Blocks.piston_head, BptBlockIgnore.class); + BlueprintManager.registerSchematicClass(Blocks.snow, SchematicIgnore.class); + BlueprintManager.registerSchematicClass(Blocks.tallgrass, SchematicIgnore.class); + BlueprintManager.registerSchematicClass(Blocks.ice, SchematicIgnore.class); + BlueprintManager.registerSchematicClass(Blocks.piston_head, SchematicIgnore.class); - BlueprintManager.registerSchematicClass(Blocks.dirt, BptBlockDirt.class); - BlueprintManager.registerSchematicClass(Blocks.grass, BptBlockDirt.class); - BlueprintManager.registerSchematicClass(Blocks.farmland, BptBlockDirt.class); + BlueprintManager.registerSchematicClass(Blocks.dirt, SchematicDirt.class); + BlueprintManager.registerSchematicClass(Blocks.grass, SchematicDirt.class); + BlueprintManager.registerSchematicClass(Blocks.farmland, SchematicDirt.class); - BlueprintManager.registerSchematicClass(Blocks.torch, BptBlockWallSide.class); - BlueprintManager.registerSchematicClass(Blocks.redstone_torch, BptBlockWallSide.class); - BlueprintManager.registerSchematicClass(Blocks.unlit_redstone_torch, BptBlockWallSide.class); + BlueprintManager.registerSchematicClass(Blocks.torch, SchematicWallSide.class); + BlueprintManager.registerSchematicClass(Blocks.redstone_torch, SchematicWallSide.class); + BlueprintManager.registerSchematicClass(Blocks.unlit_redstone_torch, SchematicWallSide.class); - BlueprintManager.registerSchematicClass(Blocks.ladder, BptBlockRotateMeta.class, new int[]{2, 5, 3, 4}, true); - BlueprintManager.registerSchematicClass(Blocks.fence_gate, BptBlockRotateMeta.class, new int[]{0, 1, 2, 3}, true); + BlueprintManager.registerSchematicClass(Blocks.ladder, SchematicRotateMeta.class, new int[]{2, 5, 3, 4}, true); + BlueprintManager.registerSchematicClass(Blocks.fence_gate, SchematicRotateMeta.class, new int[]{0, 1, 2, 3}, true); - BlueprintManager.registerSchematicClass(Blocks.furnace, BptBlockRotateInventory.class, new int[]{2, 5, 3, 4}, true); - BlueprintManager.registerSchematicClass(Blocks.lit_furnace, BptBlockRotateInventory.class, new int[]{2, 5, 3, 4}, true); - BlueprintManager.registerSchematicClass(Blocks.chest, BptBlockRotateInventory.class, new int[]{2, 5, 3, 4}, true); - BlueprintManager.registerSchematicClass(Blocks.dispenser, BptBlockRotateInventory.class, new int[]{2, 5, 3, 4}, true); + BlueprintManager.registerSchematicClass(Blocks.furnace, SchematicRotateInventory.class, new int[]{2, 5, 3, 4}, true); + BlueprintManager.registerSchematicClass(Blocks.lit_furnace, SchematicRotateInventory.class, new int[]{2, 5, 3, 4}, true); + BlueprintManager.registerSchematicClass(Blocks.chest, SchematicRotateInventory.class, new int[]{2, 5, 3, 4}, true); + BlueprintManager.registerSchematicClass(Blocks.dispenser, SchematicRotateInventory.class, new int[]{2, 5, 3, 4}, true); - BlueprintManager.registerSchematicClass(Blocks.brewing_stand, BptBlockInventory.class); + BlueprintManager.registerSchematicClass(Blocks.brewing_stand, SchematicInventory.class); - BlueprintManager.registerSchematicClass(Blocks.vine, BptBlockRotateMeta.class, new int[]{1, 4, 8, 2}, false); - BlueprintManager.registerSchematicClass(Blocks.trapdoor, BptBlockRotateMeta.class, new int[]{0, 1, 2, 3}, false); + BlueprintManager.registerSchematicClass(Blocks.vine, SchematicRotateMeta.class, new int[]{1, 4, 8, 2}, false); + BlueprintManager.registerSchematicClass(Blocks.trapdoor, SchematicRotateMeta.class, new int[]{0, 1, 2, 3}, false); - BlueprintManager.registerSchematicClass(Blocks.wooden_button, BptBlockLever.class); - BlueprintManager.registerSchematicClass(Blocks.stone_button, BptBlockLever.class); - BlueprintManager.registerSchematicClass(Blocks.lever, BptBlockLever.class); + BlueprintManager.registerSchematicClass(Blocks.wooden_button, SchematicLever.class); + BlueprintManager.registerSchematicClass(Blocks.stone_button, SchematicLever.class); + BlueprintManager.registerSchematicClass(Blocks.lever, SchematicLever.class); - BlueprintManager.registerSchematicClass(Blocks.stone, BptBlockCustomStack.class, new ItemStack(Blocks.stone)); - BlueprintManager.registerSchematicClass(Blocks.redstone_wire, BptBlockCustomStack.class, new ItemStack(Items.redstone)); - BlueprintManager.registerSchematicClass(Blocks.cake, BptBlockCustomStack.class, new ItemStack(Items.cake)); + BlueprintManager.registerSchematicClass(Blocks.stone, SchematicCustomStack.class, new ItemStack(Blocks.stone)); + BlueprintManager.registerSchematicClass(Blocks.redstone_wire, SchematicCustomStack.class, new ItemStack(Items.redstone)); + BlueprintManager.registerSchematicClass(Blocks.cake, SchematicCustomStack.class, new ItemStack(Items.cake)); //new BptBlockCustomStack(Blocks.crops.blockID, new ItemStack(Items.seeds)); - BlueprintManager.registerSchematicClass(Blocks.pumpkin_stem, BptBlockCustomStack.class, new ItemStack(Items.pumpkin_seeds)); - BlueprintManager.registerSchematicClass(Blocks.melon_stem, BptBlockCustomStack.class, new ItemStack(Items.melon_seeds)); - BlueprintManager.registerSchematicClass(Blocks.glowstone, BptBlockCustomStack.class, new ItemStack(Blocks.glowstone)); + BlueprintManager.registerSchematicClass(Blocks.pumpkin_stem, SchematicCustomStack.class, new ItemStack(Items.pumpkin_seeds)); + BlueprintManager.registerSchematicClass(Blocks.melon_stem, SchematicCustomStack.class, new ItemStack(Items.melon_seeds)); + BlueprintManager.registerSchematicClass(Blocks.glowstone, SchematicCustomStack.class, new ItemStack(Blocks.glowstone)); - BlueprintManager.registerSchematicClass(Blocks.powered_repeater, BptBlockRedstoneRepeater.class); - BlueprintManager.registerSchematicClass(Blocks.unpowered_repeater, BptBlockRedstoneRepeater.class); + BlueprintManager.registerSchematicClass(Blocks.powered_repeater, SchematicRedstoneRepeater.class); + BlueprintManager.registerSchematicClass(Blocks.unpowered_repeater, SchematicRedstoneRepeater.class); - BlueprintManager.registerSchematicClass(Blocks.water, BptBlockFluid.class, new ItemStack(Items.water_bucket)); - BlueprintManager.registerSchematicClass(Blocks.flowing_water, BptBlockFluid.class, new ItemStack(Items.water_bucket)); - BlueprintManager.registerSchematicClass(Blocks.lava, BptBlockFluid.class, new ItemStack(Items.lava_bucket)); - BlueprintManager.registerSchematicClass(Blocks.flowing_lava, BptBlockFluid.class, new ItemStack(Items.lava_bucket)); + BlueprintManager.registerSchematicClass(Blocks.water, SchematicFluid.class, new ItemStack(Items.water_bucket)); + BlueprintManager.registerSchematicClass(Blocks.flowing_water, SchematicFluid.class, new ItemStack(Items.water_bucket)); + BlueprintManager.registerSchematicClass(Blocks.lava, SchematicFluid.class, new ItemStack(Items.lava_bucket)); + BlueprintManager.registerSchematicClass(Blocks.flowing_lava, SchematicFluid.class, new ItemStack(Items.lava_bucket)); - BlueprintManager.registerSchematicClass(Blocks.rail, BptBlockIgnoreMeta.class); - BlueprintManager.registerSchematicClass(Blocks.detector_rail, BptBlockIgnoreMeta.class); - BlueprintManager.registerSchematicClass(Blocks.glass_pane, BptBlockIgnoreMeta.class); + BlueprintManager.registerSchematicClass(Blocks.rail, SchematicIgnoreMeta.class); + BlueprintManager.registerSchematicClass(Blocks.detector_rail, SchematicIgnoreMeta.class); + BlueprintManager.registerSchematicClass(Blocks.glass_pane, SchematicIgnoreMeta.class); - BlueprintManager.registerSchematicClass(Blocks.piston, BptBlockPiston.class); - BlueprintManager.registerSchematicClass(Blocks.piston_extension, BptBlockPiston.class); - BlueprintManager.registerSchematicClass(Blocks.sticky_piston, BptBlockPiston.class); + BlueprintManager.registerSchematicClass(Blocks.piston, SchematicPiston.class); + BlueprintManager.registerSchematicClass(Blocks.piston_extension, SchematicPiston.class); + BlueprintManager.registerSchematicClass(Blocks.sticky_piston, SchematicPiston.class); - BlueprintManager.registerSchematicClass(Blocks.lit_pumpkin, BptBlockPumpkin.class); + BlueprintManager.registerSchematicClass(Blocks.lit_pumpkin, SchematicPumpkin.class); - BlueprintManager.registerSchematicClass(Blocks.stone_stairs, BptBlockStairs.class); - BlueprintManager.registerSchematicClass(Blocks.oak_stairs, BptBlockStairs.class); - BlueprintManager.registerSchematicClass(Blocks.nether_brick_stairs, BptBlockStairs.class); - BlueprintManager.registerSchematicClass(Blocks.brick_stairs, BptBlockStairs.class); - BlueprintManager.registerSchematicClass(Blocks.stone_brick_stairs, BptBlockStairs.class); + BlueprintManager.registerSchematicClass(Blocks.stone_stairs, SchematicStairs.class); + BlueprintManager.registerSchematicClass(Blocks.oak_stairs, SchematicStairs.class); + BlueprintManager.registerSchematicClass(Blocks.nether_brick_stairs, SchematicStairs.class); + BlueprintManager.registerSchematicClass(Blocks.brick_stairs, SchematicStairs.class); + BlueprintManager.registerSchematicClass(Blocks.stone_brick_stairs, SchematicStairs.class); - BlueprintManager.registerSchematicClass(Blocks.wooden_button, BptBlockDoor.class, new ItemStack(Items.wooden_door)); - BlueprintManager.registerSchematicClass(Blocks.iron_door, BptBlockDoor.class, new ItemStack(Items.iron_door)); + BlueprintManager.registerSchematicClass(Blocks.wooden_button, SchematicDoor.class, new ItemStack(Items.wooden_door)); + BlueprintManager.registerSchematicClass(Blocks.iron_door, SchematicDoor.class, new ItemStack(Items.iron_door)); - BlueprintManager.registerSchematicClass(Blocks.bed, BptBlockBed.class); + BlueprintManager.registerSchematicClass(Blocks.bed, SchematicBed.class); - BlueprintManager.registerSchematicClass(Blocks.wall_sign, BptBlockSign.class, true); - BlueprintManager.registerSchematicClass(Blocks.standing_sign, BptBlockSign.class, false); + BlueprintManager.registerSchematicClass(Blocks.wall_sign, SchematicSign.class, true); + BlueprintManager.registerSchematicClass(Blocks.standing_sign, SchematicSign.class, false); // BUILDCRAFT BLOCKS - BlueprintManager.registerSchematicClass(architectBlock, BptBlockRotateInventory.class, new int[]{2, 5, 3, 4}, true); - BlueprintManager.registerSchematicClass(builderBlock, BptBlockRotateInventory.class, new int[]{2, 5, 3, 4}, true); + BlueprintManager.registerSchematicClass(architectBlock, SchematicRotateInventory.class, new int[]{2, 5, 3, 4}, true); + BlueprintManager.registerSchematicClass(builderBlock, SchematicRotateInventory.class, new int[]{2, 5, 3, 4}, true); - BlueprintManager.registerSchematicClass(libraryBlock, BptBlockInventory.class); + BlueprintManager.registerSchematicClass(libraryBlock, SchematicInventory.class); - BlueprintManager.registerSchematicClass(markerBlock, BptBlockWallSide.class); - BlueprintManager.registerSchematicClass(pathMarkerBlock, BptBlockWallSide.class); + BlueprintManager.registerSchematicClass(markerBlock, SchematicWallSide.class); + BlueprintManager.registerSchematicClass(pathMarkerBlock, SchematicWallSide.class); if (BuildCraftCore.loadDefaultRecipes) { loadRecipes(); diff --git a/common/buildcraft/BuildCraftEnergy.java b/common/buildcraft/BuildCraftEnergy.java index 292c9d51..991b767e 100644 --- a/common/buildcraft/BuildCraftEnergy.java +++ b/common/buildcraft/BuildCraftEnergy.java @@ -40,7 +40,7 @@ import buildcraft.energy.BlockBuildcraftFluid; import buildcraft.energy.BlockEnergyEmitter; import buildcraft.energy.BlockEnergyReceiver; import buildcraft.energy.BlockEngine; -import buildcraft.energy.BptBlockEngine; +import buildcraft.energy.SchematicEngine; import buildcraft.energy.EnergyProxy; import buildcraft.energy.GuiHandler; import buildcraft.energy.ItemBucketBuildcraft; @@ -251,7 +251,7 @@ public class BuildCraftEnergy extends BuildCraftMod { NetworkRegistry.INSTANCE.registerGuiHandler(instance, new GuiHandler()); - BlueprintManager.registerSchematicClass(engineBlock, BptBlockEngine.class); + BlueprintManager.registerSchematicClass(engineBlock, SchematicEngine.class); if (BuildCraftCore.loadDefaultRecipes) { loadRecipes(); diff --git a/common/buildcraft/BuildCraftFactory.java b/common/buildcraft/BuildCraftFactory.java index e1065566..1c193ed0 100644 --- a/common/buildcraft/BuildCraftFactory.java +++ b/common/buildcraft/BuildCraftFactory.java @@ -38,10 +38,10 @@ import buildcraft.factory.BlockPump; import buildcraft.factory.BlockQuarry; import buildcraft.factory.BlockRefinery; import buildcraft.factory.BlockTank; -import buildcraft.factory.BptBlockAutoWorkbench; -import buildcraft.factory.BptBlockFrame; -import buildcraft.factory.BptBlockRefinery; -import buildcraft.factory.BptBlockTank; +import buildcraft.factory.SchematicAutoWorkbench; +import buildcraft.factory.SchematicFrame; +import buildcraft.factory.SchematicRefinery; +import buildcraft.factory.SchematicTank; import buildcraft.factory.FactoryProxy; import buildcraft.factory.FactoryProxyClient; import buildcraft.factory.GuiHandler; @@ -146,10 +146,10 @@ public class BuildCraftFactory extends BuildCraftMod { FactoryProxy.proxy.initializeTileEntities(); - BlueprintManager.registerSchematicClass(autoWorkbenchBlock, BptBlockAutoWorkbench.class); - BlueprintManager.registerSchematicClass(frameBlock, BptBlockFrame.class); - BlueprintManager.registerSchematicClass(refineryBlock, BptBlockRefinery.class); - BlueprintManager.registerSchematicClass(tankBlock, BptBlockTank.class); + BlueprintManager.registerSchematicClass(autoWorkbenchBlock, SchematicAutoWorkbench.class); + BlueprintManager.registerSchematicClass(frameBlock, SchematicFrame.class); + BlueprintManager.registerSchematicClass(refineryBlock, SchematicRefinery.class); + BlueprintManager.registerSchematicClass(tankBlock, SchematicTank.class); if (BuildCraftCore.loadDefaultRecipes) { loadRecipes(); diff --git a/common/buildcraft/BuildCraftSilicon.java b/common/buildcraft/BuildCraftSilicon.java index 4a889db8..cf160813 100644 --- a/common/buildcraft/BuildCraftSilicon.java +++ b/common/buildcraft/BuildCraftSilicon.java @@ -16,9 +16,9 @@ import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; import buildcraft.api.blueprints.BlueprintManager; -import buildcraft.api.bptblocks.BptBlockInventory; -import buildcraft.api.bptblocks.BptBlockRotateMeta; import buildcraft.api.recipes.BuildcraftRecipes; +import buildcraft.api.schematics.SchematicInventory; +import buildcraft.api.schematics.SchematicRotateMeta; import buildcraft.api.transport.PipeWire; import buildcraft.core.DefaultProps; import buildcraft.core.InterModComms; @@ -94,8 +94,8 @@ public class BuildCraftSilicon extends BuildCraftMod { CoreProxy.proxy.registerTileEntity(TileAdvancedCraftingTable.class, "net.minecraft.src.buildcraft.factory.TileAssemblyAdvancedWorkbench"); CoreProxy.proxy.registerTileEntity(TileIntegrationTable.class, "net.minecraft.src.buildcraft.factory.TileIntegrationTable"); - BlueprintManager.registerSchematicClass(laserBlock, BptBlockRotateMeta.class, new int[]{2, 5, 3, 4}, true); - BlueprintManager.registerSchematicClass(assemblyTableBlock, BptBlockInventory.class); + BlueprintManager.registerSchematicClass(laserBlock, SchematicRotateMeta.class, new int[]{2, 5, 3, 4}, true); + BlueprintManager.registerSchematicClass(assemblyTableBlock, SchematicInventory.class); if (BuildCraftCore.loadDefaultRecipes) { loadRecipes(); diff --git a/common/buildcraft/BuildCraftTransport.java b/common/buildcraft/BuildCraftTransport.java index 6fc5bd76..e6edeb85 100644 --- a/common/buildcraft/BuildCraftTransport.java +++ b/common/buildcraft/BuildCraftTransport.java @@ -52,7 +52,7 @@ import buildcraft.transport.PipeIconProvider; import buildcraft.transport.PipeTriggerProvider; import buildcraft.transport.TransportProxy; import buildcraft.transport.WireIconProvider; -import buildcraft.transport.blueprints.BptBlockPipe; +import buildcraft.transport.blueprints.SchematicPipe; import buildcraft.transport.blueprints.BptItemPipeFilters; import buildcraft.transport.blueprints.BptPipeIron; import buildcraft.transport.blueprints.BptPipeWooden; @@ -430,7 +430,7 @@ public class BuildCraftTransport extends BuildCraftMod { TransportProxy.proxy.registerTileEntities(); - BlueprintManager.registerSchematicClass(genericPipeBlock, BptBlockPipe.class); + BlueprintManager.registerSchematicClass(genericPipeBlock, SchematicPipe.class); new BptPipeIron(pipeItemsIron); new BptPipeIron(pipeFluidsIron); diff --git a/common/buildcraft/api/blueprints/BlueprintManager.java b/common/buildcraft/api/blueprints/BlueprintManager.java index c02e6c5d..c57f31bf 100644 --- a/common/buildcraft/api/blueprints/BlueprintManager.java +++ b/common/buildcraft/api/blueprints/BlueprintManager.java @@ -31,14 +31,14 @@ public class BlueprintManager { schematicClasses.put(block, c); } - public static BptBlock newSchematic (Block block) { + public static Schematic newSchematic (Block block) { if (!schematicClasses.containsKey(block)) { - registerSchematicClass(block, BptBlock.class); + registerSchematicClass(block, Schematic.class); } try { SchematicConstructor c = schematicClasses.get(block); - return (BptBlock) c.clas.getConstructors() [0].newInstance(c.params); + return (Schematic) c.clas.getConstructors() [0].newInstance(c.params); } catch (InstantiationException e) { // TODO Auto-generated catch block e.printStackTrace(); diff --git a/common/buildcraft/api/blueprints/IBptContext.java b/common/buildcraft/api/blueprints/IBuilderContext.java similarity index 95% rename from common/buildcraft/api/blueprints/IBptContext.java rename to common/buildcraft/api/blueprints/IBuilderContext.java index 1fc70fae..4d63713b 100644 --- a/common/buildcraft/api/blueprints/IBptContext.java +++ b/common/buildcraft/api/blueprints/IBuilderContext.java @@ -16,7 +16,7 @@ import buildcraft.api.core.Position; * This interface provide contextual information when building or initializing * blueprint slots. */ -public interface IBptContext { +public interface IBuilderContext { public Position rotatePositionLeft(Position pos); diff --git a/common/buildcraft/api/blueprints/BptBlock.java b/common/buildcraft/api/blueprints/Schematic.java similarity index 85% rename from common/buildcraft/api/blueprints/BptBlock.java rename to common/buildcraft/api/blueprints/Schematic.java index 353948c5..964355fa 100755 --- a/common/buildcraft/api/blueprints/BptBlock.java +++ b/common/buildcraft/api/blueprints/Schematic.java @@ -30,22 +30,12 @@ import buildcraft.core.utils.Utils; * load in the blueprint * * Default implementations of this can be seen in the package - * buildcraft.api.bptblocks. The class BptBlockUtils provide some additional + * buildcraft.api.schematics. The class SchematicUtils provide some additional * utilities. * * Blueprints perform "id translation" in case the block ids between a blueprint - * and the world installation are different. In order to translate block ids, - * blocks needs to be uniquely identified. By default, this identification is - * done by: - * - * - the block simple class name - the tile simple class name (if any) - the - * block name - * - * In certain circumstances, the above is not enough (e.g. if several blocks - * share the same class and the same name, with no tile). In this case, - * additional data may be provided by children of this class: - * - * - mod name - custom signature + * and the world installation are different. Mapping is done through the + * builder context. * * At blueprint load time, BuildCraft will check that each block id of the * blueprint corresponds to the block id in the installation. If not, it will @@ -54,7 +44,7 @@ import buildcraft.core.utils.Utils; * such block id is found, BuildCraft will assume that the block is not * installed and will not load the blueprint. */ -public class BptBlock { +public class Schematic { public Block block = null; public int x, y, z, meta = 0; @@ -62,13 +52,13 @@ public class BptBlock { /** * This field contains requirements for a given block when stored in the * blueprint. Modders can either rely on this list or compute their own int - * BptBlock. + * Schematic. */ public ArrayList storedRequirements = new ArrayList(); /** * This tree contains additional data to be stored in the blueprint. By - * default, it will be initialized from BptBlock.initializeFromWorld with + * default, it will be initialized from Schematic.readFromWord with * the standard readNBT function of the corresponding tile (if any) and will * be loaded from BptBlock.buildBlock using the standard writeNBT function. */ @@ -82,8 +72,8 @@ public class BptBlock { @SuppressWarnings("unchecked") @Override - public BptBlock clone() { - BptBlock obj = BlueprintManager.newSchematic(block); + public Schematic clone() { + Schematic obj = BlueprintManager.newSchematic(block); obj.x = x; obj.y = y; @@ -97,7 +87,7 @@ public class BptBlock { return obj; } - public final LinkedList getRequirements(IBptContext context) { + public final LinkedList getRequirements(IBuilderContext context) { LinkedList res = new LinkedList(); addRequirements(context, res); @@ -111,7 +101,7 @@ public class BptBlock { * requirements are met, they will be removed all at once from the builder, * before calling buildBlock. */ - public void addRequirements(IBptContext context, LinkedList requirements) { + public void addRequirements(IBuilderContext context, LinkedList requirements) { if (block != null) { if (storedRequirements.size() != 0) { requirements.addAll(storedRequirements); @@ -138,7 +128,7 @@ public class BptBlock { * returns: what was used (similer to req, but created from stack, so that * any NBT based differences are drawn from the correct source) */ - public ItemStack useItem(IBptContext context, ItemStack req, ItemStack stack) { + public ItemStack useItem(IBuilderContext context, ItemStack req, ItemStack stack) { ItemStack result = stack.copy(); if (stack.isItemStackDamageable()) { if (req.getItemDamage() + stack.getItemDamage() <= stack.getMaxDamage()) { @@ -176,21 +166,21 @@ public class BptBlock { * the blueprint at the location given by the slot. By default, this * subprogram is permissive and doesn't take into account metadata. */ - public boolean isValid(IBptContext context) { + public boolean isValid(IBuilderContext context) { return block == context.world().getBlock(x, y, z) && meta == context.world().getBlockMetadata(x, y, z); } /** * Perform a 90 degree rotation to the slot. */ - public void rotateLeft(IBptContext context) { + public void rotateLeft(IBuilderContext context) { } /** * Places the block in the world, at the location specified in the slot. */ - public void buildBlock(IBptContext context) { + public void writeToWorld(IBuilderContext context) { // Meta needs to be specified twice, depending on the block behavior context.world().setBlock(x, y, z, block, meta, 3); context.world().setBlockMetadataWithNotify(x, y, z, meta, 3); @@ -234,7 +224,7 @@ public class BptBlock { * By default, if the block is a BlockContainer, tile information will be to * save / load the block. */ - public void initializeFromWorld(IBptContext context, int x, int y, int z) { + public void readFromWorld(IBuilderContext context, int x, int y, int z) { if (block instanceof BlockContainer) { TileEntity tile = context.world().getTileEntity(x, y, z); @@ -258,14 +248,10 @@ public class BptBlock { * blocks. This may be useful to adjust variable depending on surrounding * blocks that may not be there already at initial building. */ - public void postProcessing(IBptContext context) { + public void postProcessing(IBuilderContext context) { } - private boolean starMatch(String s1, String s2) { - return s1.equals("*") || s2.equals("*") || s1.equals(s2); - } - public void writeToNBT(NBTTagCompound nbt, MappingRegistry registry) { nbt.setInteger("blockId", registry.getIdForBlock(block)); nbt.setInteger("blockMeta", meta); diff --git a/common/buildcraft/api/blueprints/BptBlockUtils.java b/common/buildcraft/api/blueprints/SchematicUtils.java similarity index 76% rename from common/buildcraft/api/blueprints/BptBlockUtils.java rename to common/buildcraft/api/blueprints/SchematicUtils.java index f4708f4a..a76d8b0a 100644 --- a/common/buildcraft/api/blueprints/BptBlockUtils.java +++ b/common/buildcraft/api/blueprints/SchematicUtils.java @@ -15,9 +15,9 @@ import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; -public class BptBlockUtils { +public class SchematicUtils { - public static void requestInventoryContents(BptBlock slot, IBptContext context, LinkedList requirements) { + public static void requestInventoryContents(Schematic slot, IBuilderContext context, LinkedList requirements) { ItemStack[] stacks = getItemStacks(slot, context); for (ItemStack stack : stacks) { @@ -27,7 +27,7 @@ public class BptBlockUtils { } } - public static void initializeInventoryContents(BptBlock slot, IBptContext context, IInventory inventory) { + public static void initializeInventoryContents(Schematic slot, IBuilderContext context, IInventory inventory) { ItemStack[] stacks = new ItemStack[inventory.getSizeInventory()]; for (int i = 0; i < inventory.getSizeInventory(); ++i) { @@ -37,7 +37,7 @@ public class BptBlockUtils { setItemStacks(slot, context, stacks); } - public static void buildInventoryContents(BptBlock slot, IBptContext context, IInventory inventory) { + public static void buildInventoryContents(Schematic slot, IBuilderContext context, IInventory inventory) { ItemStack[] stacks = getItemStacks(slot, context); for (int i = 0; i < stacks.length; ++i) { @@ -45,7 +45,7 @@ public class BptBlockUtils { } } - public static ItemStack[] getItemStacks(BptBlock slot, IBptContext context) { + public static ItemStack[] getItemStacks(Schematic slot, IBuilderContext context) { NBTTagList list = (NBTTagList) slot.cpt.getTag("inv"); if (list == null) { @@ -65,7 +65,7 @@ public class BptBlockUtils { return stacks; } - public static void setItemStacks(BptBlock slot, IBptContext context, ItemStack[] stacks) { + public static void setItemStacks(Schematic slot, IBuilderContext context, ItemStack[] stacks) { NBTTagList nbttaglist = new NBTTagList(); for (ItemStack stack : stacks) { diff --git a/common/buildcraft/api/bptblocks/BptBlockBed.java b/common/buildcraft/api/schematics/SchematicBed.java similarity index 76% rename from common/buildcraft/api/bptblocks/BptBlockBed.java rename to common/buildcraft/api/schematics/SchematicBed.java index ffe79a97..1657ef11 100644 --- a/common/buildcraft/api/bptblocks/BptBlockBed.java +++ b/common/buildcraft/api/schematics/SchematicBed.java @@ -6,26 +6,26 @@ * License 1.0, or MMPL. Please check the contents of the license located in * http://www.mod-buildcraft.com/MMPL-1.0.txt */ -package buildcraft.api.bptblocks; +package buildcraft.api.schematics; import java.util.LinkedList; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; -import buildcraft.api.blueprints.BptBlock; -import buildcraft.api.blueprints.IBptContext; +import buildcraft.api.blueprints.Schematic; +import buildcraft.api.blueprints.IBuilderContext; -public class BptBlockBed extends BptBlock { +public class SchematicBed extends Schematic { @Override - public void addRequirements(IBptContext context, LinkedList requirements) { + public void addRequirements(IBuilderContext context, LinkedList requirements) { if ((meta & 8) == 0) { requirements.add(new ItemStack(Items.bed)); } } @Override - public void rotateLeft(IBptContext context) { + public void rotateLeft(IBuilderContext context) { int orientation = (meta & 7); int others = meta - orientation; @@ -46,7 +46,7 @@ public class BptBlockBed extends BptBlock { } @Override - public void buildBlock(IBptContext context) { + public void writeToWorld(IBuilderContext context) { if ((meta & 8) != 0) { return; } diff --git a/common/buildcraft/api/bptblocks/BptBlockCustomStack.java b/common/buildcraft/api/schematics/SchematicCustomStack.java similarity index 60% rename from common/buildcraft/api/bptblocks/BptBlockCustomStack.java rename to common/buildcraft/api/schematics/SchematicCustomStack.java index 9bd08ee8..2ceaab4b 100644 --- a/common/buildcraft/api/bptblocks/BptBlockCustomStack.java +++ b/common/buildcraft/api/schematics/SchematicCustomStack.java @@ -6,24 +6,24 @@ * License 1.0, or MMPL. Please check the contents of the license located in * http://www.mod-buildcraft.com/MMPL-1.0.txt */ -package buildcraft.api.bptblocks; +package buildcraft.api.schematics; import java.util.LinkedList; import net.minecraft.item.ItemStack; -import buildcraft.api.blueprints.BptBlock; -import buildcraft.api.blueprints.IBptContext; +import buildcraft.api.blueprints.Schematic; +import buildcraft.api.blueprints.IBuilderContext; -public class BptBlockCustomStack extends BptBlock { +public class SchematicCustomStack extends Schematic { final ItemStack customStack; - public BptBlockCustomStack(ItemStack customStack) { + public SchematicCustomStack(ItemStack customStack) { this.customStack = customStack; } @Override - public void addRequirements(IBptContext context, LinkedList requirements) { + public void addRequirements(IBuilderContext context, LinkedList requirements) { requirements.add(customStack.copy()); } diff --git a/common/buildcraft/api/bptblocks/BptBlockDirt.java b/common/buildcraft/api/schematics/SchematicDirt.java similarity index 66% rename from common/buildcraft/api/bptblocks/BptBlockDirt.java rename to common/buildcraft/api/schematics/SchematicDirt.java index 0585747c..ad1d81c6 100644 --- a/common/buildcraft/api/bptblocks/BptBlockDirt.java +++ b/common/buildcraft/api/schematics/SchematicDirt.java @@ -6,30 +6,30 @@ * License 1.0, or MMPL. Please check the contents of the license located in * http://www.mod-buildcraft.com/MMPL-1.0.txt */ -package buildcraft.api.bptblocks; +package buildcraft.api.schematics; import java.util.LinkedList; import net.minecraft.block.Block; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; -import buildcraft.api.blueprints.BptBlock; -import buildcraft.api.blueprints.IBptContext; +import buildcraft.api.blueprints.Schematic; +import buildcraft.api.blueprints.IBuilderContext; -public class BptBlockDirt extends BptBlock { +public class SchematicDirt extends Schematic { @Override - public void addRequirements(IBptContext context, LinkedList requirements) { + public void addRequirements(IBuilderContext context, LinkedList requirements) { requirements.add(new ItemStack(Blocks.dirt)); } @Override - public void buildBlock(IBptContext context) { + public void writeToWorld(IBuilderContext context) { context.world().setBlock(x, y, z, Blocks.dirt, meta, 3); } @Override - public boolean isValid(IBptContext context) { + public boolean isValid(IBuilderContext context) { Block block = context.world().getBlock(x, y, z); return block == Blocks.dirt || block == Blocks.grass || block == Blocks.farmland; diff --git a/common/buildcraft/api/bptblocks/BptBlockDoor.java b/common/buildcraft/api/schematics/SchematicDoor.java similarity index 73% rename from common/buildcraft/api/bptblocks/BptBlockDoor.java rename to common/buildcraft/api/schematics/SchematicDoor.java index dc80441a..9bce6125 100644 --- a/common/buildcraft/api/bptblocks/BptBlockDoor.java +++ b/common/buildcraft/api/schematics/SchematicDoor.java @@ -6,31 +6,31 @@ * License 1.0, or MMPL. Please check the contents of the license located in * http://www.mod-buildcraft.com/MMPL-1.0.txt */ -package buildcraft.api.bptblocks; +package buildcraft.api.schematics; import java.util.LinkedList; import net.minecraft.item.ItemStack; -import buildcraft.api.blueprints.BptBlock; -import buildcraft.api.blueprints.IBptContext; +import buildcraft.api.blueprints.Schematic; +import buildcraft.api.blueprints.IBuilderContext; -public class BptBlockDoor extends BptBlock { +public class SchematicDoor extends Schematic { final ItemStack stack; - public BptBlockDoor(ItemStack stack) { + public SchematicDoor(ItemStack stack) { this.stack = stack; } @Override - public void addRequirements(IBptContext context, LinkedList requirements) { + public void addRequirements(IBuilderContext context, LinkedList requirements) { if ((meta & 8) == 0) { requirements.add(stack.copy()); } } @Override - public void rotateLeft(IBptContext context) { + public void rotateLeft(IBuilderContext context) { int orientation = (meta & 3); int others = meta - orientation; @@ -56,7 +56,7 @@ public class BptBlockDoor extends BptBlock { } @Override - public void buildBlock(IBptContext context) { + public void writeToWorld(IBuilderContext context) { context.world().setBlock(x, y, z, block, meta, 3); context.world().setBlock(x, y + 1, z, block, meta + 8, 3); diff --git a/common/buildcraft/api/bptblocks/BptBlockFluid.java b/common/buildcraft/api/schematics/SchematicFluid.java similarity index 64% rename from common/buildcraft/api/bptblocks/BptBlockFluid.java rename to common/buildcraft/api/schematics/SchematicFluid.java index 713ef9ce..5631fb9d 100644 --- a/common/buildcraft/api/bptblocks/BptBlockFluid.java +++ b/common/buildcraft/api/schematics/SchematicFluid.java @@ -6,31 +6,31 @@ * License 1.0, or MMPL. Please check the contents of the license located in * http://www.mod-buildcraft.com/MMPL-1.0.txt */ -package buildcraft.api.bptblocks; +package buildcraft.api.schematics; import java.util.LinkedList; import net.minecraft.item.ItemStack; -import buildcraft.api.blueprints.BptBlock; -import buildcraft.api.blueprints.IBptContext; +import buildcraft.api.blueprints.Schematic; +import buildcraft.api.blueprints.IBuilderContext; -public class BptBlockFluid extends BptBlock { +public class SchematicFluid extends Schematic { private final ItemStack bucketStack; - public BptBlockFluid(ItemStack bucketStack) { + public SchematicFluid(ItemStack bucketStack) { this.bucketStack = bucketStack; } @Override - public void addRequirements(IBptContext context, LinkedList requirements) { + public void addRequirements(IBuilderContext context, LinkedList requirements) { if (meta == 0) { requirements.add(bucketStack.copy()); } } @Override - public boolean isValid(IBptContext context) { + public boolean isValid(IBuilderContext context) { if (meta == 0) { return block == context.world().getBlock(x, y, z) && context.world().getBlockMetadata(x, y, z) == 0; } else { @@ -39,7 +39,7 @@ public class BptBlockFluid extends BptBlock { } @Override - public void rotateLeft(IBptContext context) { + public void rotateLeft(IBuilderContext context) { } @@ -49,7 +49,7 @@ public class BptBlockFluid extends BptBlock { } @Override - public void buildBlock(IBptContext context) { + public void writeToWorld(IBuilderContext context) { if (meta == 0) { context.world().setBlock(x, y, z, block, 0,1); } diff --git a/common/buildcraft/api/bptblocks/BptBlockIgnore.java b/common/buildcraft/api/schematics/SchematicIgnore.java similarity index 59% rename from common/buildcraft/api/bptblocks/BptBlockIgnore.java rename to common/buildcraft/api/schematics/SchematicIgnore.java index 7cde6528..d026efd9 100644 --- a/common/buildcraft/api/bptblocks/BptBlockIgnore.java +++ b/common/buildcraft/api/schematics/SchematicIgnore.java @@ -6,28 +6,28 @@ * License 1.0, or MMPL. Please check the contents of the license located in * http://www.mod-buildcraft.com/MMPL-1.0.txt */ -package buildcraft.api.bptblocks; +package buildcraft.api.schematics; import java.util.LinkedList; import net.minecraft.item.ItemStack; -import buildcraft.api.blueprints.BptBlock; -import buildcraft.api.blueprints.IBptContext; +import buildcraft.api.blueprints.Schematic; +import buildcraft.api.blueprints.IBuilderContext; -public class BptBlockIgnore extends BptBlock { +public class SchematicIgnore extends Schematic { @Override - public void addRequirements(IBptContext context, LinkedList requirements) { + public void addRequirements(IBuilderContext context, LinkedList requirements) { requirements.add(new ItemStack(block, 0, 0)); } @Override - public boolean isValid(IBptContext context) { + public boolean isValid(IBuilderContext context) { return true; } @Override - public void rotateLeft(IBptContext context) { + public void rotateLeft(IBuilderContext context) { } diff --git a/common/buildcraft/api/bptblocks/BptBlockIgnoreMeta.java b/common/buildcraft/api/schematics/SchematicIgnoreMeta.java similarity index 60% rename from common/buildcraft/api/bptblocks/BptBlockIgnoreMeta.java rename to common/buildcraft/api/schematics/SchematicIgnoreMeta.java index 6c263cb7..25988d23 100644 --- a/common/buildcraft/api/bptblocks/BptBlockIgnoreMeta.java +++ b/common/buildcraft/api/schematics/SchematicIgnoreMeta.java @@ -6,23 +6,23 @@ * License 1.0, or MMPL. Please check the contents of the license located in * http://www.mod-buildcraft.com/MMPL-1.0.txt */ -package buildcraft.api.bptblocks; +package buildcraft.api.schematics; import java.util.LinkedList; import net.minecraft.item.ItemStack; -import buildcraft.api.blueprints.BptBlock; -import buildcraft.api.blueprints.IBptContext; +import buildcraft.api.blueprints.Schematic; +import buildcraft.api.blueprints.IBuilderContext; -public class BptBlockIgnoreMeta extends BptBlock { +public class SchematicIgnoreMeta extends Schematic { @Override - public void addRequirements(IBptContext context, LinkedList requirements) { + public void addRequirements(IBuilderContext context, LinkedList requirements) { requirements.add(new ItemStack(block, 1, 0)); } @Override - public boolean isValid(IBptContext context) { + public boolean isValid(IBuilderContext context) { return block == context.world().getBlock(x, y, z); } } diff --git a/common/buildcraft/api/bptblocks/BptBlockInventory.java b/common/buildcraft/api/schematics/SchematicInventory.java similarity index 67% rename from common/buildcraft/api/bptblocks/BptBlockInventory.java rename to common/buildcraft/api/schematics/SchematicInventory.java index 0a0a06d9..60e27786 100644 --- a/common/buildcraft/api/bptblocks/BptBlockInventory.java +++ b/common/buildcraft/api/schematics/SchematicInventory.java @@ -6,17 +6,17 @@ * License 1.0, or MMPL. Please check the contents of the license located in * http://www.mod-buildcraft.com/MMPL-1.0.txt */ -package buildcraft.api.bptblocks; +package buildcraft.api.schematics; import net.minecraft.inventory.IInventory; -import buildcraft.api.blueprints.BptBlock; -import buildcraft.api.blueprints.IBptContext; +import buildcraft.api.blueprints.Schematic; +import buildcraft.api.blueprints.IBuilderContext; -public class BptBlockInventory extends BptBlock { +public class SchematicInventory extends Schematic { @Override - public void buildBlock(IBptContext context) { - super.buildBlock(context); + public void writeToWorld(IBuilderContext context) { + super.writeToWorld(context); IInventory inv = (IInventory) context.world().getTileEntity(x, y, z); diff --git a/common/buildcraft/api/bptblocks/BptBlockLever.java b/common/buildcraft/api/schematics/SchematicLever.java similarity index 66% rename from common/buildcraft/api/bptblocks/BptBlockLever.java rename to common/buildcraft/api/schematics/SchematicLever.java index 1e0ad759..c1beb341 100644 --- a/common/buildcraft/api/bptblocks/BptBlockLever.java +++ b/common/buildcraft/api/schematics/SchematicLever.java @@ -6,22 +6,22 @@ * License 1.0, or MMPL. Please check the contents of the license located in * http://www.mod-buildcraft.com/MMPL-1.0.txt */ -package buildcraft.api.bptblocks; +package buildcraft.api.schematics; import java.util.LinkedList; import net.minecraft.item.ItemStack; -import buildcraft.api.blueprints.IBptContext; +import buildcraft.api.blueprints.IBuilderContext; -public class BptBlockLever extends BptBlockWallSide { +public class SchematicLever extends SchematicWallSide { @Override - public void addRequirements(IBptContext context, LinkedList requirements) { + public void addRequirements(IBuilderContext context, LinkedList requirements) { //requirements.add(new ItemStack(slot.blockId, 1, 0)); } @Override - public void rotateLeft(IBptContext context) { + public void rotateLeft(IBuilderContext context) { int status = meta - (meta & 7); meta -= status; diff --git a/common/buildcraft/api/bptblocks/BptBlockPiston.java b/common/buildcraft/api/schematics/SchematicPiston.java similarity index 66% rename from common/buildcraft/api/bptblocks/BptBlockPiston.java rename to common/buildcraft/api/schematics/SchematicPiston.java index 1d3a85ac..6431b776 100644 --- a/common/buildcraft/api/bptblocks/BptBlockPiston.java +++ b/common/buildcraft/api/schematics/SchematicPiston.java @@ -6,18 +6,18 @@ * License 1.0, or MMPL. Please check the contents of the license located in * http://www.mod-buildcraft.com/MMPL-1.0.txt */ -package buildcraft.api.bptblocks; +package buildcraft.api.schematics; -import buildcraft.api.blueprints.IBptContext; +import buildcraft.api.blueprints.IBuilderContext; -public class BptBlockPiston extends BptBlockRotateMeta { +public class SchematicPiston extends SchematicRotateMeta { - public BptBlockPiston() { + public SchematicPiston() { super(new int[] { 2, 5, 3, 4 }, true); } @Override - public void buildBlock(IBptContext context) { + public void writeToWorld(IBuilderContext context) { int localMeta = meta & 7; context.world().setBlock(x, y, z, block, localMeta, 3); diff --git a/common/buildcraft/api/bptblocks/BptBlockStairs.java b/common/buildcraft/api/schematics/SchematicPumpkin.java similarity index 64% rename from common/buildcraft/api/bptblocks/BptBlockStairs.java rename to common/buildcraft/api/schematics/SchematicPumpkin.java index 5b8bf1d1..63ef7ff4 100644 --- a/common/buildcraft/api/bptblocks/BptBlockStairs.java +++ b/common/buildcraft/api/schematics/SchematicPumpkin.java @@ -6,37 +6,37 @@ * License 1.0, or MMPL. Please check the contents of the license located in * http://www.mod-buildcraft.com/MMPL-1.0.txt */ -package buildcraft.api.bptblocks; +package buildcraft.api.schematics; import java.util.LinkedList; import net.minecraft.item.ItemStack; -import buildcraft.api.blueprints.BptBlock; -import buildcraft.api.blueprints.IBptContext; +import buildcraft.api.blueprints.Schematic; +import buildcraft.api.blueprints.IBuilderContext; -public class BptBlockStairs extends BptBlock { +public class SchematicPumpkin extends Schematic { @Override - public void addRequirements(IBptContext context, LinkedList requirements) { + public void addRequirements(IBuilderContext context, LinkedList requirements) { requirements.add(new ItemStack(block, 1, 0)); } @Override - public boolean isValid(IBptContext context) { + public boolean isValid(IBuilderContext context) { return block == context.world().getBlock(x, y, z); } @Override - public void rotateLeft(IBptContext context) { + public void rotateLeft(IBuilderContext context) { switch (meta) { case 0: - meta = 2; + meta = 1; break; case 1: - meta = 3; + meta = 2; break; case 2: - meta = 1; + meta = 3; break; case 3: meta = 0; diff --git a/common/buildcraft/api/bptblocks/BptBlockRedstoneRepeater.java b/common/buildcraft/api/schematics/SchematicRedstoneRepeater.java similarity index 68% rename from common/buildcraft/api/bptblocks/BptBlockRedstoneRepeater.java rename to common/buildcraft/api/schematics/SchematicRedstoneRepeater.java index c5f23f17..5686a208 100644 --- a/common/buildcraft/api/bptblocks/BptBlockRedstoneRepeater.java +++ b/common/buildcraft/api/schematics/SchematicRedstoneRepeater.java @@ -6,24 +6,24 @@ * License 1.0, or MMPL. Please check the contents of the license located in * http://www.mod-buildcraft.com/MMPL-1.0.txt */ -package buildcraft.api.bptblocks; +package buildcraft.api.schematics; import java.util.LinkedList; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; -import buildcraft.api.blueprints.BptBlock; -import buildcraft.api.blueprints.IBptContext; +import buildcraft.api.blueprints.Schematic; +import buildcraft.api.blueprints.IBuilderContext; -public class BptBlockRedstoneRepeater extends BptBlock { +public class SchematicRedstoneRepeater extends Schematic { @Override - public void addRequirements(IBptContext context, LinkedList requirements) { + public void addRequirements(IBuilderContext context, LinkedList requirements) { requirements.add(new ItemStack(Items.repeater)); } @Override - public void rotateLeft(IBptContext context) { + public void rotateLeft(IBuilderContext context) { int step = meta - (meta & 3); switch (meta - step) { diff --git a/common/buildcraft/api/bptblocks/BptBlockRotateInventory.java b/common/buildcraft/api/schematics/SchematicRotateInventory.java similarity index 64% rename from common/buildcraft/api/bptblocks/BptBlockRotateInventory.java rename to common/buildcraft/api/schematics/SchematicRotateInventory.java index 01ed6ed8..0c0bf347 100644 --- a/common/buildcraft/api/bptblocks/BptBlockRotateInventory.java +++ b/common/buildcraft/api/schematics/SchematicRotateInventory.java @@ -6,21 +6,21 @@ * License 1.0, or MMPL. Please check the contents of the license located in * http://www.mod-buildcraft.com/MMPL-1.0.txt */ -package buildcraft.api.bptblocks; +package buildcraft.api.schematics; import net.minecraft.inventory.IInventory; -import buildcraft.api.blueprints.IBptContext; +import buildcraft.api.blueprints.IBuilderContext; -public class BptBlockRotateInventory extends BptBlockRotateMeta { +public class SchematicRotateInventory extends SchematicRotateMeta { - public BptBlockRotateInventory(int[] rotations, boolean rotateForward) { + public SchematicRotateInventory(int[] rotations, boolean rotateForward) { super(rotations, rotateForward); } @Override - public void buildBlock(IBptContext context) { - super.buildBlock(context); + public void writeToWorld(IBuilderContext context) { + super.writeToWorld(context); IInventory inv = (IInventory) context.world().getTileEntity(x, y, z); diff --git a/common/buildcraft/api/bptblocks/BptBlockRotateMeta.java b/common/buildcraft/api/schematics/SchematicRotateMeta.java similarity index 75% rename from common/buildcraft/api/bptblocks/BptBlockRotateMeta.java rename to common/buildcraft/api/schematics/SchematicRotateMeta.java index b360bf01..3cbcfd22 100644 --- a/common/buildcraft/api/bptblocks/BptBlockRotateMeta.java +++ b/common/buildcraft/api/schematics/SchematicRotateMeta.java @@ -6,22 +6,22 @@ * License 1.0, or MMPL. Please check the contents of the license located in * http://www.mod-buildcraft.com/MMPL-1.0.txt */ -package buildcraft.api.bptblocks; +package buildcraft.api.schematics; import java.util.LinkedList; import net.minecraft.item.ItemStack; -import buildcraft.api.blueprints.BptBlock; -import buildcraft.api.blueprints.IBptContext; +import buildcraft.api.blueprints.Schematic; +import buildcraft.api.blueprints.IBuilderContext; -public class BptBlockRotateMeta extends BptBlock { +public class SchematicRotateMeta extends Schematic { int[] rot; boolean rotateForward; int infoMask = 0; - public BptBlockRotateMeta(int[] rotations, boolean rotateForward) { + public SchematicRotateMeta(int[] rotations, boolean rotateForward) { rot = rotations; for (int element : rot) { @@ -38,17 +38,17 @@ public class BptBlockRotateMeta extends BptBlock { } @Override - public void addRequirements(IBptContext context, LinkedList requirements) { + public void addRequirements(IBuilderContext context, LinkedList requirements) { requirements.add(new ItemStack(block, 1, 0)); } @Override - public boolean isValid(IBptContext context) { + public boolean isValid(IBuilderContext context) { return block == context.world().getBlock(x, y, z); } @Override - public void rotateLeft(IBptContext context) { + public void rotateLeft(IBuilderContext context) { int pos = meta & infoMask; int others = meta - pos; diff --git a/common/buildcraft/api/bptblocks/BptBlockSign.java b/common/buildcraft/api/schematics/SchematicSign.java similarity index 70% rename from common/buildcraft/api/bptblocks/BptBlockSign.java rename to common/buildcraft/api/schematics/SchematicSign.java index cc558806..d70c7fdb 100644 --- a/common/buildcraft/api/bptblocks/BptBlockSign.java +++ b/common/buildcraft/api/schematics/SchematicSign.java @@ -6,31 +6,31 @@ * License 1.0, or MMPL. Please check the contents of the license located in * http://www.mod-buildcraft.com/MMPL-1.0.txt */ -package buildcraft.api.bptblocks; +package buildcraft.api.schematics; import java.util.LinkedList; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; import net.minecraftforge.common.util.ForgeDirection; -import buildcraft.api.blueprints.BptBlock; -import buildcraft.api.blueprints.IBptContext; +import buildcraft.api.blueprints.Schematic; +import buildcraft.api.blueprints.IBuilderContext; -public class BptBlockSign extends BptBlock { +public class SchematicSign extends Schematic { boolean isWall; - public BptBlockSign(boolean isWall) { + public SchematicSign(boolean isWall) { this.isWall = isWall; } @Override - public void addRequirements(IBptContext context, LinkedList requirements) { + public void addRequirements(IBuilderContext context, LinkedList requirements) { requirements.add(new ItemStack(Items.sign)); } @Override - public void rotateLeft(IBptContext context) { + public void rotateLeft(IBuilderContext context) { if (!isWall) { double angle = ((meta) * 360.0) / 16.0; angle += 90.0; diff --git a/common/buildcraft/api/bptblocks/BptBlockPumpkin.java b/common/buildcraft/api/schematics/SchematicStairs.java similarity index 64% rename from common/buildcraft/api/bptblocks/BptBlockPumpkin.java rename to common/buildcraft/api/schematics/SchematicStairs.java index 4e1d0f4b..6377c20a 100644 --- a/common/buildcraft/api/bptblocks/BptBlockPumpkin.java +++ b/common/buildcraft/api/schematics/SchematicStairs.java @@ -6,38 +6,38 @@ * License 1.0, or MMPL. Please check the contents of the license located in * http://www.mod-buildcraft.com/MMPL-1.0.txt */ -package buildcraft.api.bptblocks; +package buildcraft.api.schematics; import java.util.LinkedList; import net.minecraft.item.ItemStack; -import buildcraft.api.blueprints.BptBlock; -import buildcraft.api.blueprints.IBptContext; +import buildcraft.api.blueprints.Schematic; +import buildcraft.api.blueprints.IBuilderContext; -public class BptBlockPumpkin extends BptBlock { +public class SchematicStairs extends Schematic { @Override - public void addRequirements(IBptContext context, LinkedList requirements) { + public void addRequirements(IBuilderContext context, LinkedList requirements) { requirements.add(new ItemStack(block, 1, 0)); } @Override - public boolean isValid(IBptContext context) { + public boolean isValid(IBuilderContext context) { return block == context.world().getBlock(x, y, z); } @Override - public void rotateLeft(IBptContext context) { + public void rotateLeft(IBuilderContext context) { switch (meta) { case 0: - meta = 1; - break; - case 1: meta = 2; break; - case 2: + case 1: meta = 3; break; + case 2: + meta = 1; + break; case 3: meta = 0; break; diff --git a/common/buildcraft/api/bptblocks/BptBlockWallSide.java b/common/buildcraft/api/schematics/SchematicWallSide.java similarity index 68% rename from common/buildcraft/api/bptblocks/BptBlockWallSide.java rename to common/buildcraft/api/schematics/SchematicWallSide.java index 75616dde..190da120 100644 --- a/common/buildcraft/api/bptblocks/BptBlockWallSide.java +++ b/common/buildcraft/api/schematics/SchematicWallSide.java @@ -6,23 +6,23 @@ * License 1.0, or MMPL. Please check the contents of the license located in * http://www.mod-buildcraft.com/MMPL-1.0.txt */ -package buildcraft.api.bptblocks; +package buildcraft.api.schematics; import java.util.LinkedList; import net.minecraft.item.ItemStack; -import buildcraft.api.blueprints.BptBlock; -import buildcraft.api.blueprints.IBptContext; +import buildcraft.api.blueprints.Schematic; +import buildcraft.api.blueprints.IBuilderContext; -public class BptBlockWallSide extends BptBlock { +public class SchematicWallSide extends Schematic { @Override - public void addRequirements(IBptContext context, LinkedList requirements) { + public void addRequirements(IBuilderContext context, LinkedList requirements) { requirements.add(new ItemStack(block, 1, 0)); } @Override - public void rotateLeft(IBptContext context) { + public void rotateLeft(IBuilderContext context) { final int XPos = 2; final int XNeg = 1; final int ZPos = 4; diff --git a/common/buildcraft/api/bptblocks/package-info.java b/common/buildcraft/api/schematics/package-info.java similarity index 77% rename from common/buildcraft/api/bptblocks/package-info.java rename to common/buildcraft/api/schematics/package-info.java index 227914c4..58f91521 100644 --- a/common/buildcraft/api/bptblocks/package-info.java +++ b/common/buildcraft/api/schematics/package-info.java @@ -1,3 +1,3 @@ @API(apiVersion="1.0",owner="BuildCraftAPI|blueprints",provides="BuildCraftAPI|bptblocks") -package buildcraft.api.bptblocks; +package buildcraft.api.schematics; import cpw.mods.fml.common.API; \ No newline at end of file diff --git a/common/buildcraft/builders/TileArchitect.java b/common/buildcraft/builders/TileArchitect.java index 05b522a0..2d020771 100644 --- a/common/buildcraft/builders/TileArchitect.java +++ b/common/buildcraft/builders/TileArchitect.java @@ -17,7 +17,7 @@ import net.minecraft.nbt.NBTTagList; import net.minecraft.util.AxisAlignedBB; import net.minecraftforge.common.util.ForgeDirection; import buildcraft.BuildCraftBuilders; -import buildcraft.api.blueprints.IBptContext; +import buildcraft.api.blueprints.IBuilderContext; import buildcraft.api.core.IAreaProvider; import buildcraft.core.Box; import buildcraft.core.Box.Kind; @@ -157,7 +157,7 @@ public class TileArchitect extends TileBuildCraft implements IInventory, IBoxPro private BlueprintBase createBptBlueprint() { Blueprint result = new Blueprint(box.sizeX(), box.sizeY(), box.sizeZ()); - IBptContext context = result.getContext(worldObj, box); + IBuilderContext context = result.getContext(worldObj, box); for (int x = box.xMin; x <= box.xMax; ++x) { for (int y = box.yMin; y <= box.yMax; ++y) { diff --git a/common/buildcraft/builders/TileBuilder.java b/common/buildcraft/builders/TileBuilder.java index 115b58bb..7681cbc3 100644 --- a/common/buildcraft/builders/TileBuilder.java +++ b/common/buildcraft/builders/TileBuilder.java @@ -20,7 +20,7 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.util.AxisAlignedBB; import net.minecraftforge.common.util.ForgeDirection; import buildcraft.BuildCraftBuilders; -import buildcraft.api.blueprints.BptBlock; +import buildcraft.api.blueprints.Schematic; import buildcraft.api.gates.IAction; import buildcraft.api.power.IPowerReceptor; import buildcraft.api.power.PowerHandler; @@ -637,10 +637,10 @@ public class TileBuilder extends TileBuildCraft implements IBuilderInventory, public void debugForceBlueprintCompletion () { if (bluePrintBuilder != null) { - BptBlock slot = bluePrintBuilder.getNextBlock(worldObj, this); + Schematic slot = bluePrintBuilder.getNextBlock(worldObj, this); if (slot != null) { - slot.buildBlock(bluePrintBuilder.context); + slot.writeToWorld(bluePrintBuilder.context); } } } diff --git a/common/buildcraft/core/blueprints/Blueprint.java b/common/buildcraft/core/blueprints/Blueprint.java index a66871c4..f63ea5b1 100644 --- a/common/buildcraft/core/blueprints/Blueprint.java +++ b/common/buildcraft/core/blueprints/Blueprint.java @@ -14,8 +14,8 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; import net.minecraft.tileentity.TileEntity; import buildcraft.api.blueprints.BlueprintManager; -import buildcraft.api.blueprints.BptBlock; -import buildcraft.api.blueprints.IBptContext; +import buildcraft.api.blueprints.Schematic; +import buildcraft.api.blueprints.IBuilderContext; import buildcraft.core.utils.BCLog; import buildcraft.core.utils.Utils; @@ -28,10 +28,10 @@ public class Blueprint extends BlueprintBase { super(sizeX, sizeY, sizeZ); } - public void readFromWorld(IBptContext context, TileEntity anchorTile, int x, int y, int z) { + public void readFromWorld(IBuilderContext context, TileEntity anchorTile, int x, int y, int z) { Block block = anchorTile.getWorldObj().getBlock(x, y, z); - BptBlock slot = BlueprintManager.newSchematic(block); + Schematic slot = BlueprintManager.newSchematic(block); slot.x = (int) (x - context.surroundingBox().pMin().x); slot.y = (int) (y - context.surroundingBox().pMin().y); @@ -44,7 +44,7 @@ public class Blueprint extends BlueprintBase { } try { - slot.initializeFromWorld(context, x, y, z); + slot.readFromWorld(context, x, y, z); contents[slot.x][slot.y][slot.z] = slot; } catch (Throwable t) { // Defensive code against errors in implementers diff --git a/common/buildcraft/core/blueprints/BlueprintBase.java b/common/buildcraft/core/blueprints/BlueprintBase.java index 7f383849..5ffc3003 100644 --- a/common/buildcraft/core/blueprints/BlueprintBase.java +++ b/common/buildcraft/core/blueprints/BlueprintBase.java @@ -12,7 +12,7 @@ import net.minecraft.block.Block; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.world.World; import buildcraft.api.blueprints.BlueprintManager; -import buildcraft.api.blueprints.BptBlock; +import buildcraft.api.blueprints.Schematic; import buildcraft.api.blueprints.MappingRegistry; import buildcraft.builders.blueprints.BlueprintId; import buildcraft.core.Box; @@ -21,7 +21,7 @@ import buildcraft.core.utils.BCLog; public abstract class BlueprintBase { - public BptBlock contents[][][]; + public Schematic contents[][][]; public int anchorX, anchorY, anchorZ; public int sizeX, sizeY, sizeZ; public BlueprintId id = new BlueprintId(); @@ -33,7 +33,7 @@ public abstract class BlueprintBase { } public BlueprintBase(int sizeX, int sizeY, int sizeZ) { - contents = new BptBlock[sizeX][sizeY][sizeZ]; + contents = new Schematic[sizeX][sizeY][sizeZ]; this.sizeX = sizeX; this.sizeY = sizeY; @@ -56,7 +56,7 @@ public abstract class BlueprintBase { } public void rotateLeft(BptContext context) { - BptBlock newContents[][][] = new BptBlock[sizeZ][sizeY][sizeX]; + Schematic newContents[][][] = new Schematic[sizeZ][sizeY][sizeX]; for (int x = 0; x < sizeZ; ++x) { for (int y = 0; y < sizeY; ++y) { @@ -147,7 +147,7 @@ public abstract class BlueprintBase { author = nbt.getString("author"); - contents = new BptBlock [sizeX][sizeY][sizeZ]; + contents = new Schematic [sizeX][sizeY][sizeZ]; try { loadContents (nbt); @@ -219,7 +219,7 @@ public abstract class BlueprintBase { res.id = id; res.author = author; - res.contents = new BptBlock[sizeX][sizeY][sizeZ]; + res.contents = new Schematic[sizeX][sizeY][sizeZ]; res.mapping = mapping.clone (); diff --git a/common/buildcraft/core/blueprints/BptBuilderBase.java b/common/buildcraft/core/blueprints/BptBuilderBase.java index d3d4de2a..1424cb2d 100644 --- a/common/buildcraft/core/blueprints/BptBuilderBase.java +++ b/common/buildcraft/core/blueprints/BptBuilderBase.java @@ -10,7 +10,7 @@ package buildcraft.core.blueprints; import net.minecraft.util.AxisAlignedBB; import net.minecraft.world.World; -import buildcraft.api.blueprints.BptBlock; +import buildcraft.api.blueprints.Schematic; import buildcraft.api.core.IAreaProvider; import buildcraft.core.Box; import buildcraft.core.IBuilderInventory; @@ -35,7 +35,7 @@ public abstract class BptBuilderBase implements IAreaProvider { context = bluePrint.getContext(world, box); } - public abstract BptBlock getNextBlock(World world, IBuilderInventory inv); + public abstract Schematic getNextBlock(World world, IBuilderInventory inv); @Override public int xMin() { diff --git a/common/buildcraft/core/blueprints/BptBuilderBlueprint.java b/common/buildcraft/core/blueprints/BptBuilderBlueprint.java index f7993328..322ca4ec 100644 --- a/common/buildcraft/core/blueprints/BptBuilderBlueprint.java +++ b/common/buildcraft/core/blueprints/BptBuilderBlueprint.java @@ -18,8 +18,8 @@ import java.util.Map.Entry; import net.minecraft.item.ItemStack; import net.minecraft.world.World; import net.minecraft.world.WorldSettings.GameType; -import buildcraft.api.blueprints.BptBlock; -import buildcraft.api.blueprints.BptBlock.Mode; +import buildcraft.api.blueprints.Schematic; +import buildcraft.api.blueprints.Schematic.Mode; import buildcraft.api.core.StackKey; import buildcraft.core.IBuilderInventory; import buildcraft.core.utils.BCLog; @@ -27,11 +27,11 @@ import buildcraft.core.utils.BlockUtil; public class BptBuilderBlueprint extends BptBuilderBase { - LinkedList clearList = new LinkedList(); - LinkedList primaryList = new LinkedList(); - LinkedList secondaryList = new LinkedList(); + LinkedList clearList = new LinkedList(); + LinkedList primaryList = new LinkedList(); + LinkedList secondaryList = new LinkedList(); - LinkedList postProcessingList = new LinkedList(); + LinkedList postProcessingList = new LinkedList(); public LinkedList neededItems = new LinkedList (); @@ -45,12 +45,12 @@ public class BptBuilderBlueprint extends BptBuilderBase { int yCoord = j + y - bluePrint.anchorY; int zCoord = k + z - bluePrint.anchorZ; - BptBlock slot = bluePrint.contents[i][j][k]; + Schematic slot = bluePrint.contents[i][j][k]; if (slot != null) { slot = slot.clone(); } else { - slot = new BptBlock(); + slot = new Schematic(); slot.meta = 0; slot.block = null; } @@ -74,12 +74,12 @@ public class BptBuilderBlueprint extends BptBuilderBase { int yCoord = j + y - bluePrint.anchorY; int zCoord = k + z - bluePrint.anchorZ; - BptBlock slot = bluePrint.contents[i][j][k]; + Schematic slot = bluePrint.contents[i][j][k]; if (slot != null) { slot = slot.clone(); } else { - slot = new BptBlock(); + slot = new Schematic(); slot.meta = 0; slot.block = null; } @@ -117,9 +117,9 @@ public class BptBuilderBlueprint extends BptBuilderBase { } @Override - public BptBlock getNextBlock(World world, IBuilderInventory inv) { + public Schematic getNextBlock(World world, IBuilderInventory inv) { if (clearList.size() != 0) { - BptBlock slot = internalGetNextBlock(world, inv, clearList); + Schematic slot = internalGetNextBlock(world, inv, clearList); checkDone(); if (slot != null) { @@ -128,7 +128,7 @@ public class BptBuilderBlueprint extends BptBuilderBase { } if (primaryList.size() != 0) { - BptBlock slot = internalGetNextBlock(world, inv, primaryList); + Schematic slot = internalGetNextBlock(world, inv, primaryList); checkDone(); if (slot != null) { @@ -137,7 +137,7 @@ public class BptBuilderBlueprint extends BptBuilderBase { } if (secondaryList.size() != 0) { - BptBlock slot = internalGetNextBlock(world, inv, secondaryList); + Schematic slot = internalGetNextBlock(world, inv, secondaryList); checkDone(); if (slot != null) { @@ -150,13 +150,13 @@ public class BptBuilderBlueprint extends BptBuilderBase { return null; } - public BptBlock internalGetNextBlock(World world, IBuilderInventory inv, LinkedList list) { - LinkedList failSlots = new LinkedList(); + public Schematic internalGetNextBlock(World world, IBuilderInventory inv, LinkedList list) { + LinkedList failSlots = new LinkedList(); - BptBlock result = null; + Schematic result = null; while (list.size() > 0) { - BptBlock slot = list.removeFirst(); + Schematic slot = list.removeFirst(); boolean getNext = false; @@ -197,7 +197,7 @@ public class BptBuilderBlueprint extends BptBuilderBase { return result; } - public boolean checkRequirements(IBuilderInventory inv, BptBlock slot) { + public boolean checkRequirements(IBuilderInventory inv, Schematic slot) { if (slot.block == null) { return true; } @@ -258,7 +258,7 @@ public class BptBuilderBlueprint extends BptBuilderBase { return true; } - public void useRequirements(IBuilderInventory inv, BptBlock slot) { + public void useRequirements(IBuilderInventory inv, Schematic slot) { if (slot.block == null) { return; } @@ -334,7 +334,7 @@ public class BptBuilderBlueprint extends BptBuilderBase { HashMap computeStacks = new HashMap (); - for (BptBlock slot : primaryList) { + for (Schematic slot : primaryList) { LinkedList stacks = new LinkedList(); @@ -365,7 +365,7 @@ public class BptBuilderBlueprint extends BptBuilderBase { } } - for (BptBlock slot : secondaryList) { + for (Schematic slot : secondaryList) { LinkedList stacks = slot.getRequirements(context); for (ItemStack stack : stacks) { @@ -414,7 +414,7 @@ public class BptBuilderBlueprint extends BptBuilderBase { @Override public void postProcessing(World world) { - for (BptBlock s : postProcessingList) { + for (Schematic s : postProcessingList) { try { s.postProcessing(context); } catch (Throwable t) { diff --git a/common/buildcraft/core/blueprints/BptBuilderTemplate.java b/common/buildcraft/core/blueprints/BptBuilderTemplate.java index b3c64cfd..f07be3b2 100644 --- a/common/buildcraft/core/blueprints/BptBuilderTemplate.java +++ b/common/buildcraft/core/blueprints/BptBuilderTemplate.java @@ -11,14 +11,14 @@ package buildcraft.core.blueprints; import java.util.LinkedList; import net.minecraft.world.World; -import buildcraft.api.blueprints.BptBlock; -import buildcraft.api.blueprints.BptBlock.Mode; +import buildcraft.api.blueprints.Schematic; +import buildcraft.api.blueprints.Schematic.Mode; import buildcraft.core.IBuilderInventory; public class BptBuilderTemplate extends BptBuilderBase { - LinkedList clearList = new LinkedList(); - LinkedList buildList = new LinkedList(); + LinkedList clearList = new LinkedList(); + LinkedList buildList = new LinkedList(); public BptBuilderTemplate(BlueprintBase bluePrint, World world, int x, int y, int z) { super(bluePrint, world, x, y, z); @@ -30,10 +30,10 @@ public class BptBuilderTemplate extends BptBuilderBase { int yCoord = j + y - bluePrint.anchorY; int zCoord = k + z - bluePrint.anchorZ; - BptBlock slot = bluePrint.contents[i][j][k]; + Schematic slot = bluePrint.contents[i][j][k]; if (slot == null || slot.block == null) { - slot = new BptBlock(); + slot = new Schematic(); slot.meta = 0; slot.block = null; slot.x = xCoord; @@ -55,12 +55,12 @@ public class BptBuilderTemplate extends BptBuilderBase { int yCoord = j + y - bluePrint.anchorY; int zCoord = k + z - bluePrint.anchorZ; - BptBlock slot = bluePrint.contents[i][j][k]; + Schematic slot = bluePrint.contents[i][j][k]; if (slot != null) { slot = slot.clone(); } else { - slot = new BptBlock(); + slot = new Schematic(); slot.meta = 0; slot.block = null; } @@ -88,9 +88,9 @@ public class BptBuilderTemplate extends BptBuilderBase { } @Override - public BptBlock getNextBlock(World world, IBuilderInventory inv) { + public Schematic getNextBlock(World world, IBuilderInventory inv) { if (clearList.size() != 0) { - BptBlock slot = internalGetNextBlock(world, inv, clearList); + Schematic slot = internalGetNextBlock(world, inv, clearList); checkDone(); if (slot != null) { @@ -101,7 +101,7 @@ public class BptBuilderTemplate extends BptBuilderBase { } if (buildList.size() != 0) { - BptBlock slot = internalGetNextBlock(world, inv, buildList); + Schematic slot = internalGetNextBlock(world, inv, buildList); checkDone(); if (slot != null) { @@ -116,11 +116,11 @@ public class BptBuilderTemplate extends BptBuilderBase { return null; } - public BptBlock internalGetNextBlock(World world, IBuilderInventory inv, LinkedList list) { - BptBlock result = null; + public Schematic internalGetNextBlock(World world, IBuilderInventory inv, LinkedList list) { + Schematic result = null; while (list.size() > 0) { - BptBlock slot = list.getFirst(); + Schematic slot = list.getFirst(); // Note from CJ: I have no idea what this code is supposed to do, so I'm not touching it. /*if (slot.blockId == world.getBlockId(slot.x, slot.y, slot.z)) { diff --git a/common/buildcraft/core/blueprints/BptContext.java b/common/buildcraft/core/blueprints/BptContext.java index 76427479..2231a2c4 100644 --- a/common/buildcraft/core/blueprints/BptContext.java +++ b/common/buildcraft/core/blueprints/BptContext.java @@ -9,13 +9,13 @@ package buildcraft.core.blueprints; import net.minecraft.world.World; -import buildcraft.api.blueprints.IBptContext; +import buildcraft.api.blueprints.IBuilderContext; import buildcraft.api.blueprints.MappingRegistry; import buildcraft.api.core.IBox; import buildcraft.api.core.Position; import buildcraft.core.Box; -public class BptContext implements IBptContext { +public class BptContext implements IBuilderContext { public Box box; public World world; diff --git a/common/buildcraft/energy/BptBlockEngine.java b/common/buildcraft/energy/SchematicEngine.java similarity index 74% rename from common/buildcraft/energy/BptBlockEngine.java rename to common/buildcraft/energy/SchematicEngine.java index 8f1fb2c9..e5b3a081 100644 --- a/common/buildcraft/energy/BptBlockEngine.java +++ b/common/buildcraft/energy/SchematicEngine.java @@ -9,13 +9,13 @@ package buildcraft.energy; import net.minecraftforge.common.util.ForgeDirection; -import buildcraft.api.blueprints.BptBlock; -import buildcraft.api.blueprints.IBptContext; +import buildcraft.api.blueprints.Schematic; +import buildcraft.api.blueprints.IBuilderContext; -public class BptBlockEngine extends BptBlock { +public class SchematicEngine extends Schematic { @Override - public void rotateLeft(IBptContext context) { + public void rotateLeft(IBuilderContext context) { int o = cpt.getInteger("orientation"); o = ForgeDirection.values()[o].getRotation(ForgeDirection.DOWN).ordinal(); @@ -24,14 +24,14 @@ public class BptBlockEngine extends BptBlock { } @Override - public void initializeFromWorld(IBptContext context, int x, int y, int z) { + public void readFromWorld(IBuilderContext context, int x, int y, int z) { TileEngine engine = (TileEngine) context.world().getTileEntity(x, y, z); cpt.setInteger("orientation", engine.orientation.ordinal()); } @Override - public void buildBlock(IBptContext context) { + public void writeToWorld(IBuilderContext context) { context.world().setBlock(x, y, z, block, meta,1); TileEngine engine = (TileEngine) context.world().getTileEntity(x, y, z); diff --git a/common/buildcraft/factory/BptBlockAutoWorkbench.java b/common/buildcraft/factory/SchematicAutoWorkbench.java similarity index 51% rename from common/buildcraft/factory/BptBlockAutoWorkbench.java rename to common/buildcraft/factory/SchematicAutoWorkbench.java index 8e3973e1..c61fb99e 100644 --- a/common/buildcraft/factory/BptBlockAutoWorkbench.java +++ b/common/buildcraft/factory/SchematicAutoWorkbench.java @@ -12,33 +12,33 @@ import java.util.LinkedList; import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; -import buildcraft.api.blueprints.BptBlock; -import buildcraft.api.blueprints.BptBlockUtils; -import buildcraft.api.blueprints.IBptContext; +import buildcraft.api.blueprints.Schematic; +import buildcraft.api.blueprints.SchematicUtils; +import buildcraft.api.blueprints.IBuilderContext; -public class BptBlockAutoWorkbench extends BptBlock { +public class SchematicAutoWorkbench extends Schematic { @Override - public void addRequirements(IBptContext context, LinkedList requirements) { + public void addRequirements(IBuilderContext context, LinkedList requirements) { super.addRequirements(context, requirements); - BptBlockUtils.requestInventoryContents(this, context, requirements); + SchematicUtils.requestInventoryContents(this, context, requirements); } @Override - public void initializeFromWorld(IBptContext context, int x, int y, int z) { + public void readFromWorld(IBuilderContext context, int x, int y, int z) { IInventory inventory = (IInventory) context.world().getTileEntity(x, y, z); - BptBlockUtils.initializeInventoryContents(this, context, inventory); + SchematicUtils.initializeInventoryContents(this, context, inventory); } @Override - public void buildBlock(IBptContext context) { - super.buildBlock(context); + public void writeToWorld(IBuilderContext context) { + super.writeToWorld(context); IInventory inventory = (IInventory) context.world().getTileEntity(x, y, z); - BptBlockUtils.buildInventoryContents(this, context, inventory); + SchematicUtils.buildInventoryContents(this, context, inventory); } } diff --git a/common/buildcraft/factory/BptBlockFrame.java b/common/buildcraft/factory/SchematicFrame.java similarity index 64% rename from common/buildcraft/factory/BptBlockFrame.java rename to common/buildcraft/factory/SchematicFrame.java index df22f89f..6a503b37 100644 --- a/common/buildcraft/factory/BptBlockFrame.java +++ b/common/buildcraft/factory/SchematicFrame.java @@ -11,13 +11,13 @@ package buildcraft.factory; import java.util.LinkedList; import net.minecraft.item.ItemStack; -import buildcraft.api.blueprints.BptBlock; -import buildcraft.api.blueprints.IBptContext; +import buildcraft.api.blueprints.Schematic; +import buildcraft.api.blueprints.IBuilderContext; -public class BptBlockFrame extends BptBlock { +public class SchematicFrame extends Schematic { @Override - public void addRequirements(IBptContext context, LinkedList requirements) { + public void addRequirements(IBuilderContext context, LinkedList requirements) { } diff --git a/common/buildcraft/factory/BptBlockRefinery.java b/common/buildcraft/factory/SchematicRefinery.java similarity index 77% rename from common/buildcraft/factory/BptBlockRefinery.java rename to common/buildcraft/factory/SchematicRefinery.java index 8813fcd1..e9fc86b2 100644 --- a/common/buildcraft/factory/BptBlockRefinery.java +++ b/common/buildcraft/factory/SchematicRefinery.java @@ -9,18 +9,18 @@ package buildcraft.factory; import net.minecraftforge.common.util.ForgeDirection; -import buildcraft.api.blueprints.BptBlock; -import buildcraft.api.blueprints.IBptContext; +import buildcraft.api.blueprints.Schematic; +import buildcraft.api.blueprints.IBuilderContext; -public class BptBlockRefinery extends BptBlock { +public class SchematicRefinery extends Schematic { @Override - public void rotateLeft(IBptContext context) { + public void rotateLeft(IBuilderContext context) { meta = ForgeDirection.values()[meta].getRotation(ForgeDirection.DOWN).ordinal(); } @Override - public void initializeFromWorld(IBptContext context, int x, int y, int z) { + public void readFromWorld(IBuilderContext context, int x, int y, int z) { TileRefinery refinery = (TileRefinery) context.world().getTileEntity(x, y, z); // slot.cpt.setInteger("filter0", refinery.getFilter(0)); @@ -28,8 +28,8 @@ public class BptBlockRefinery extends BptBlock { } @Override - public void buildBlock(IBptContext context) { - super.buildBlock(context); + public void writeToWorld(IBuilderContext context) { + super.writeToWorld(context); TileRefinery refinery = (TileRefinery) context.world().getTileEntity(x, y, z); diff --git a/common/buildcraft/factory/BptBlockTank.java b/common/buildcraft/factory/SchematicTank.java similarity index 60% rename from common/buildcraft/factory/BptBlockTank.java rename to common/buildcraft/factory/SchematicTank.java index 718e24c7..65e8e3cd 100644 --- a/common/buildcraft/factory/BptBlockTank.java +++ b/common/buildcraft/factory/SchematicTank.java @@ -8,18 +8,18 @@ */ package buildcraft.factory; -import buildcraft.api.blueprints.BptBlock; -import buildcraft.api.blueprints.IBptContext; +import buildcraft.api.blueprints.Schematic; +import buildcraft.api.blueprints.IBuilderContext; -public class BptBlockTank extends BptBlock { +public class SchematicTank extends Schematic { @Override - public void initializeFromWorld(IBptContext context, int x, int y, int z) { + public void readFromWorld(IBuilderContext context, int x, int y, int z) { } @Override - public void buildBlock(IBptContext context) { + public void writeToWorld(IBuilderContext context) { context.world().setBlock(x, y, z, block, meta, 3); } diff --git a/common/buildcraft/transport/blueprints/BptItemPipeFilters.java b/common/buildcraft/transport/blueprints/BptItemPipeFilters.java index e51cad90..efa97e2f 100644 --- a/common/buildcraft/transport/blueprints/BptItemPipeFilters.java +++ b/common/buildcraft/transport/blueprints/BptItemPipeFilters.java @@ -10,8 +10,8 @@ package buildcraft.transport.blueprints; import net.minecraft.item.Item; import net.minecraftforge.common.util.ForgeDirection; -import buildcraft.api.blueprints.BptBlock; -import buildcraft.api.blueprints.IBptContext; +import buildcraft.api.blueprints.Schematic; +import buildcraft.api.blueprints.IBuilderContext; import buildcraft.core.inventory.SimpleInventory; public class BptItemPipeFilters extends BptPipeExtension { @@ -22,7 +22,7 @@ public class BptItemPipeFilters extends BptPipeExtension { @Override - public void rotateLeft(BptBlock slot, IBptContext context) { + public void rotateLeft(Schematic slot, IBuilderContext context) { SimpleInventory inv = new SimpleInventory(54, "Filters", 1); SimpleInventory newInv = new SimpleInventory(54, "Filters", 1); inv.readFromNBT(slot.cpt); diff --git a/common/buildcraft/transport/blueprints/BptPipeExtension.java b/common/buildcraft/transport/blueprints/BptPipeExtension.java index 5e17bff4..ddb96d1b 100755 --- a/common/buildcraft/transport/blueprints/BptPipeExtension.java +++ b/common/buildcraft/transport/blueprints/BptPipeExtension.java @@ -3,8 +3,8 @@ package buildcraft.transport.blueprints; import java.util.HashMap; import net.minecraft.item.Item; -import buildcraft.api.blueprints.BptBlock; -import buildcraft.api.blueprints.IBptContext; +import buildcraft.api.blueprints.Schematic; +import buildcraft.api.blueprints.IBuilderContext; public class BptPipeExtension { @@ -14,11 +14,11 @@ public class BptPipeExtension { bptPipeExtensionRegistry.put(i, this); } - public void postProcessing(BptBlock slot, IBptContext context) { + public void postProcessing(Schematic slot, IBuilderContext context) { } - public void rotateLeft(BptBlock slot, IBptContext context) { + public void rotateLeft(Schematic slot, IBuilderContext context) { } diff --git a/common/buildcraft/transport/blueprints/BptPipeIron.java b/common/buildcraft/transport/blueprints/BptPipeIron.java index 4e079e61..ca708727 100644 --- a/common/buildcraft/transport/blueprints/BptPipeIron.java +++ b/common/buildcraft/transport/blueprints/BptPipeIron.java @@ -10,8 +10,8 @@ package buildcraft.transport.blueprints; import net.minecraft.item.Item; import net.minecraftforge.common.util.ForgeDirection; -import buildcraft.api.blueprints.BptBlock; -import buildcraft.api.blueprints.IBptContext; +import buildcraft.api.blueprints.Schematic; +import buildcraft.api.blueprints.IBuilderContext; public class BptPipeIron extends BptPipeExtension { @@ -20,7 +20,7 @@ public class BptPipeIron extends BptPipeExtension { } @Override - public void rotateLeft(BptBlock slot, IBptContext context) { + public void rotateLeft(Schematic slot, IBuilderContext context) { int orientation = slot.meta & 7; int others = slot.meta - orientation; diff --git a/common/buildcraft/transport/blueprints/BptPipeWooden.java b/common/buildcraft/transport/blueprints/BptPipeWooden.java index 22d2874d..e4232a81 100644 --- a/common/buildcraft/transport/blueprints/BptPipeWooden.java +++ b/common/buildcraft/transport/blueprints/BptPipeWooden.java @@ -10,8 +10,8 @@ package buildcraft.transport.blueprints; import net.minecraft.item.Item; import net.minecraftforge.common.util.ForgeDirection; -import buildcraft.api.blueprints.BptBlock; -import buildcraft.api.blueprints.IBptContext; +import buildcraft.api.blueprints.Schematic; +import buildcraft.api.blueprints.IBuilderContext; public class BptPipeWooden extends BptPipeExtension { @@ -20,7 +20,7 @@ public class BptPipeWooden extends BptPipeExtension { } @Override - public void rotateLeft(BptBlock slot, IBptContext context) { + public void rotateLeft(Schematic slot, IBuilderContext context) { int orientation = slot.meta & 7; int others = slot.meta - orientation; diff --git a/common/buildcraft/transport/blueprints/BptBlockPipe.java b/common/buildcraft/transport/blueprints/SchematicPipe.java similarity index 82% rename from common/buildcraft/transport/blueprints/BptBlockPipe.java rename to common/buildcraft/transport/blueprints/SchematicPipe.java index 9c1efb99..8bb18d0c 100644 --- a/common/buildcraft/transport/blueprints/BptBlockPipe.java +++ b/common/buildcraft/transport/blueprints/SchematicPipe.java @@ -13,16 +13,16 @@ import java.util.LinkedList; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; -import buildcraft.api.blueprints.BptBlock; -import buildcraft.api.blueprints.IBptContext; +import buildcraft.api.blueprints.Schematic; +import buildcraft.api.blueprints.IBuilderContext; import buildcraft.transport.BlockGenericPipe; import buildcraft.transport.Pipe; import buildcraft.transport.TileGenericPipe.SideProperties; -public class BptBlockPipe extends BptBlock { +public class SchematicPipe extends Schematic { @Override - public void addRequirements(IBptContext context, LinkedList requirements) { + public void addRequirements(IBuilderContext context, LinkedList requirements) { Item pipeItem = context.getMappingRegistry().getItemForId (cpt.getInteger("pipeId")); requirements.add(new ItemStack(pipeItem)); @@ -31,7 +31,7 @@ public class BptBlockPipe extends BptBlock { } @Override - public boolean isValid(IBptContext context) { + public boolean isValid(IBuilderContext context) { Pipe pipe = BlockGenericPipe.getPipe(context.world(), x, y, z); if (BlockGenericPipe.isValid(pipe)) { @@ -43,7 +43,7 @@ public class BptBlockPipe extends BptBlock { } @Override - public void rotateLeft(IBptContext context) { + public void rotateLeft(IBuilderContext context) { SideProperties props = new SideProperties (); props.readFromNBT(cpt); @@ -58,7 +58,7 @@ public class BptBlockPipe extends BptBlock { } @Override - public void buildBlock(IBptContext context) { + public void writeToWorld(IBuilderContext context) { cpt.setInteger("x", x); cpt.setInteger("y", y); cpt.setInteger("z", z); @@ -74,7 +74,7 @@ public class BptBlockPipe extends BptBlock { } @Override - public void initializeFromWorld(IBptContext context, int x, int y, int z) { + public void readFromWorld(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); @@ -90,7 +90,7 @@ public class BptBlockPipe extends BptBlock { } @Override - public void postProcessing(IBptContext context) { + public void postProcessing(IBuilderContext context) { Item pipeItem = context.getMappingRegistry().getItemForId(cpt.getInteger("pipeId")); if (BptPipeExtension.contains(pipeItem)) {