From b07d0b059d5aabb09f5c8391882f7ee4e01304f0 Mon Sep 17 00:00:00 2001 From: SpaceToad Date: Sat, 5 Apr 2014 19:03:53 +0200 Subject: [PATCH] made progress for item requirements support in blueprints, for #1565 --- common/buildcraft/BuildCraftBuilders.java | 14 ++--- .../buildcraft/api/blueprints/Schematic.java | 21 ------- .../api/blueprints/SchematicBlock.java | 2 +- .../api/blueprints/SchematicBlockBase.java | 58 ++++++++++++++++++ .../api/blueprints/SchematicEntity.java | 56 +++++++++++++++++- .../api/blueprints/SchematicMask.java | 2 +- .../builders/schematics/SchematicHanging.java | 32 ++++++++++ .../schematics/SchematicMinecart.java | 11 ++++ .../core/blueprints/BlueprintBase.java | 10 ++-- .../core/blueprints/BptBuilderBlueprint.java | 59 ++++++++++++++++--- .../core/blueprints/BptBuilderTemplate.java | 6 +- .../core/blueprints/BuildingSlot.java | 3 + .../core/blueprints/BuildingSlotBlock.java | 7 ++- .../core/blueprints/BuildingSlotEntity.java | 19 ++++++ 14 files changed, 251 insertions(+), 49 deletions(-) create mode 100755 common/buildcraft/api/blueprints/SchematicBlockBase.java diff --git a/common/buildcraft/BuildCraftBuilders.java b/common/buildcraft/BuildCraftBuilders.java index 3aa75732..4b17b337 100644 --- a/common/buildcraft/BuildCraftBuilders.java +++ b/common/buildcraft/BuildCraftBuilders.java @@ -264,14 +264,14 @@ public class BuildCraftBuilders extends BuildCraftMod { // Standard entities - SchematicRegistry.registerSchematicEntity(EntityMinecartEmpty.class, SchematicMinecart.class); - SchematicRegistry.registerSchematicEntity(EntityMinecartFurnace.class, SchematicMinecart.class); - SchematicRegistry.registerSchematicEntity(EntityMinecartTNT.class, SchematicMinecart.class); - SchematicRegistry.registerSchematicEntity(EntityMinecartChest.class, SchematicMinecart.class); - SchematicRegistry.registerSchematicEntity(EntityMinecartHopper.class, SchematicMinecart.class); + SchematicRegistry.registerSchematicEntity(EntityMinecartEmpty.class, SchematicMinecart.class, Items.minecart); + SchematicRegistry.registerSchematicEntity(EntityMinecartFurnace.class, SchematicMinecart.class, Items.furnace_minecart); + SchematicRegistry.registerSchematicEntity(EntityMinecartTNT.class, SchematicMinecart.class, Items.tnt_minecart); + SchematicRegistry.registerSchematicEntity(EntityMinecartChest.class, SchematicMinecart.class, Items.chest_minecart); + SchematicRegistry.registerSchematicEntity(EntityMinecartHopper.class, SchematicMinecart.class, Items.hopper_minecart); - SchematicRegistry.registerSchematicEntity(EntityPainting.class, SchematicHanging.class); - SchematicRegistry.registerSchematicEntity(EntityItemFrame.class, SchematicHanging.class); + SchematicRegistry.registerSchematicEntity(EntityPainting.class, SchematicHanging.class, Items.painting); + SchematicRegistry.registerSchematicEntity(EntityItemFrame.class, SchematicHanging.class, Items.item_frame); // BuildCraft blocks diff --git a/common/buildcraft/api/blueprints/Schematic.java b/common/buildcraft/api/blueprints/Schematic.java index 8b8d75a5..bfaff95f 100755 --- a/common/buildcraft/api/blueprints/Schematic.java +++ b/common/buildcraft/api/blueprints/Schematic.java @@ -108,15 +108,6 @@ public class Schematic { return result; } - /** - * Return true if the block on the world correspond to the block stored in - * 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(IBuilderContext context, int x, int y, int z) { - return true; - } - /** * Perform a 90 degree rotation to the slot. */ @@ -132,18 +123,6 @@ public class Schematic { } - public void writeCompleted(IBuilderContext context, int x, int y, int z, double completed) { - - } - - /** - * Return true if the block should not be placed to the world. Requirements - * will not be asked on such a block, and building will not be called. - */ - public boolean ignoreBuilding() { - return false; - } - /** * Initializes a slot from the blueprint according to an objet placed on {x, * y, z} on the world. This typically means adding entries in slot.cpt. Note diff --git a/common/buildcraft/api/blueprints/SchematicBlock.java b/common/buildcraft/api/blueprints/SchematicBlock.java index 419944f9..8786107e 100755 --- a/common/buildcraft/api/blueprints/SchematicBlock.java +++ b/common/buildcraft/api/blueprints/SchematicBlock.java @@ -18,7 +18,7 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; import buildcraft.core.utils.Utils; -public class SchematicBlock extends Schematic implements Comparable { +public class SchematicBlock extends SchematicBlockBase implements Comparable { public Block block = null; public int meta = 0; diff --git a/common/buildcraft/api/blueprints/SchematicBlockBase.java b/common/buildcraft/api/blueprints/SchematicBlockBase.java new file mode 100755 index 00000000..3ff1cf9d --- /dev/null +++ b/common/buildcraft/api/blueprints/SchematicBlockBase.java @@ -0,0 +1,58 @@ +/** + * Copyright (c) 2011-2014, SpaceToad and the BuildCraft Team + * http://www.mod-buildcraft.com + * + * BuildCraft is distributed under the terms of the Minecraft Mod Public + * 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.blueprints; + + +/** + * This class allow to specify specific behavior for blocks stored in + * blueprints: + * + * - what items needs to be used to create that block - how the block has to be + * built on the world - how to rotate the block - what extra data to store / + * load in the blueprint + * + * Default implementations of this can be seen in the package + * 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. 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 + * perform a search through the block list, and upon matching signature, it will + * translate all blocks ids of the blueprint to the installation ones. If no + * such block id is found, BuildCraft will assume that the block is not + * installed and will not load the blueprint. + */ +public class SchematicBlockBase extends Schematic { + + /** + * Return true if the block on the world correspond to the block stored in + * 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(IBuilderContext context, int x, int y, int z) { + return true; + } + + public void writeCompleted(IBuilderContext context, int x, int y, int z, double completed) { + + } + + /** + * Return true if the block should not be placed to the world. Requirements + * will not be asked on such a block, and building will not be called. + */ + public boolean ignoreBuilding() { + return false; + } + +} diff --git a/common/buildcraft/api/blueprints/SchematicEntity.java b/common/buildcraft/api/blueprints/SchematicEntity.java index 7e5498b9..8d6a2e6e 100755 --- a/common/buildcraft/api/blueprints/SchematicEntity.java +++ b/common/buildcraft/api/blueprints/SchematicEntity.java @@ -8,20 +8,32 @@ */ package buildcraft.api.blueprints; +import java.util.ArrayList; + import net.minecraft.entity.Entity; import net.minecraft.entity.EntityList; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagDouble; import net.minecraft.nbt.NBTTagFloat; import net.minecraft.nbt.NBTTagList; import buildcraft.api.core.Position; +import buildcraft.core.utils.Utils; -public class SchematicEntity { +public class SchematicEntity extends Schematic { public Class entity; public NBTTagCompound cpt = new NBTTagCompound(); + /** + * 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 + * Schematic. + */ + public ItemStack [] storedRequirements = new ItemStack [0]; + public void writeToWorld(IBuilderContext context, CoordTransformation transform) { NBTTagList nbttaglist = cpt.getTagList("Pos", 6); Position pos = new Position(nbttaglist.func_150309_d(0), @@ -44,6 +56,7 @@ public class SchematicEntity { cpt.setTag("Pos", this.newDoubleNBTList(new double[] {pos.x, pos.y, pos.z})); } + @Override public void rotateLeft(IBuilderContext context) { NBTTagList nbttaglist = cpt.getTagList("Pos", 6); Position pos = new Position(nbttaglist.func_150309_d(0), @@ -57,13 +70,54 @@ public class SchematicEntity { cpt.setTag("Rotation", this.newFloatNBTList(new float[] {yaw, nbttaglist.func_150308_e (1)})); } + @Override public void writeToNBT(NBTTagCompound nbt, MappingRegistry registry) { nbt.setInteger ("entityId", registry.getIdForEntity(entity)); nbt.setTag("entity", cpt); + + NBTTagList rq = new NBTTagList(); + + for (ItemStack stack : storedRequirements) { + NBTTagCompound sub = new NBTTagCompound(); + stack.writeToNBT(stack.writeToNBT(sub)); + sub.setInteger("id", registry.getIdForItem(stack.getItem())); + rq.appendTag(sub); + } + + nbt.setTag("rq", rq); } + @Override public void readFromNBT(NBTTagCompound nbt, MappingRegistry registry) { cpt = nbt.getCompoundTag("entity"); + + NBTTagList rq = nbt.getTagList("rq", Utils.NBTTag_Types.NBTTagCompound.ordinal()); + + ArrayList rqs = new ArrayList(); + + for (int i = 0; i < rq.tagCount(); ++i) { + try { + NBTTagCompound sub = rq.getCompoundTagAt(i); + + if (sub.getInteger("id") >= 0) { + // Maps the id in the blueprint to the id in the world + sub.setInteger("id", Item.itemRegistry + .getIDForObject(registry.getItemForId(sub + .getInteger("id")))); + + rqs.add(ItemStack.loadItemStackFromNBT(sub)); + } else { + // TODO: requirement can't be retreived, this blueprint is + // only useable in creative + } + } catch (Throwable t) { + t.printStackTrace(); + // TODO: requirement can't be retreived, this blueprint is + // only useable in creative + } + } + + storedRequirements = rqs.toArray(new ItemStack [rqs.size()]); } protected NBTTagList newDoubleNBTList(double... par1ArrayOfDouble) { diff --git a/common/buildcraft/api/blueprints/SchematicMask.java b/common/buildcraft/api/blueprints/SchematicMask.java index 0792bd1c..8f8ded16 100755 --- a/common/buildcraft/api/blueprints/SchematicMask.java +++ b/common/buildcraft/api/blueprints/SchematicMask.java @@ -15,7 +15,7 @@ import net.minecraft.item.ItemStack; import buildcraft.core.proxy.CoreProxy; import buildcraft.core.utils.BlockUtil; -public class SchematicMask extends Schematic { +public class SchematicMask extends SchematicBlockBase { public boolean isConcrete = true; diff --git a/common/buildcraft/builders/schematics/SchematicHanging.java b/common/buildcraft/builders/schematics/SchematicHanging.java index 157b35c5..c6264338 100755 --- a/common/buildcraft/builders/schematics/SchematicHanging.java +++ b/common/buildcraft/builders/schematics/SchematicHanging.java @@ -9,6 +9,10 @@ package buildcraft.builders.schematics; import net.minecraft.entity.Entity; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; import buildcraft.api.blueprints.CoordTransformation; import buildcraft.api.blueprints.IBuilderContext; import buildcraft.api.blueprints.SchematicEntity; @@ -16,6 +20,12 @@ import buildcraft.api.core.Position; public class SchematicHanging extends SchematicEntity { + private Item baseItem; + + public SchematicHanging (Item baseItem) { + this.baseItem = baseItem; + } + @Override public void rotateLeft(IBuilderContext context) { super.rotateLeft(context); @@ -39,6 +49,13 @@ public class SchematicHanging extends SchematicEntity { cpt.setInteger("TileY", (int) pos.y); cpt.setInteger("TileZ", (int) pos.z); + if (baseItem == Items.item_frame) { + NBTTagCompound tag = cpt.getCompoundTag("Item"); + tag.setInteger("id", Item.itemRegistry.getIDForObject(context + .getMappingRegistry().getItemForId(tag.getInteger("id")))); + cpt.setTag("Item", tag); + } + super.writeToWorld(context, transform); } @@ -52,5 +69,20 @@ public class SchematicHanging extends SchematicEntity { cpt.setInteger("TileX", (int) pos.x); cpt.setInteger("TileY", (int) pos.y); cpt.setInteger("TileZ", (int) pos.z); + + if (baseItem == Items.item_frame) { + NBTTagCompound tag = cpt.getCompoundTag("Item"); + ItemStack stack = ItemStack.loadItemStackFromNBT(tag); + + storedRequirements = new ItemStack [2]; + storedRequirements [0] = new ItemStack(baseItem); + storedRequirements [1] = stack; + + tag.setInteger("id", context.getMappingRegistry().getIdForItem(stack.getItem())); + cpt.setTag("Item", tag); + } else { + storedRequirements = new ItemStack [1]; + storedRequirements [0] = new ItemStack(baseItem); + } } } diff --git a/common/buildcraft/builders/schematics/SchematicMinecart.java b/common/buildcraft/builders/schematics/SchematicMinecart.java index 507ca844..2e609b38 100755 --- a/common/buildcraft/builders/schematics/SchematicMinecart.java +++ b/common/buildcraft/builders/schematics/SchematicMinecart.java @@ -9,6 +9,8 @@ package buildcraft.builders.schematics; import net.minecraft.entity.Entity; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagList; import buildcraft.api.blueprints.CoordTransformation; import buildcraft.api.blueprints.IBuilderContext; @@ -17,6 +19,12 @@ import buildcraft.api.core.Position; public class SchematicMinecart extends SchematicEntity { + private Item baseItem; + + public SchematicMinecart (Item baseItem) { + this.baseItem = baseItem; + } + @Override public void writeToWorld(IBuilderContext context, CoordTransformation transform) { NBTTagList nbttaglist = cpt.getTagList("Pos", 6); @@ -39,5 +47,8 @@ public class SchematicMinecart extends SchematicEntity { pos.x -= 0.5; pos.z -= 0.5; cpt.setTag("Pos", this.newDoubleNBTList(new double[] {pos.x, pos.y, pos.z})); + + storedRequirements = new ItemStack [1]; + storedRequirements [0] = new ItemStack(baseItem); } } diff --git a/common/buildcraft/core/blueprints/BlueprintBase.java b/common/buildcraft/core/blueprints/BlueprintBase.java index 07bbc1d5..30eb35a8 100644 --- a/common/buildcraft/core/blueprints/BlueprintBase.java +++ b/common/buildcraft/core/blueprints/BlueprintBase.java @@ -17,7 +17,7 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; import buildcraft.api.blueprints.IBuilderContext; import buildcraft.api.blueprints.MappingRegistry; -import buildcraft.api.blueprints.Schematic; +import buildcraft.api.blueprints.SchematicBlockBase; import buildcraft.builders.blueprints.BlueprintId; import buildcraft.core.Box; import buildcraft.core.Version; @@ -25,7 +25,7 @@ import buildcraft.core.utils.BCLog; public abstract class BlueprintBase { - public Schematic contents[][][]; + public SchematicBlockBase contents[][][]; public int anchorX, anchorY, anchorZ; public int sizeX, sizeY, sizeZ; public BlueprintId id = new BlueprintId(); @@ -40,7 +40,7 @@ public abstract class BlueprintBase { } public BlueprintBase(int sizeX, int sizeY, int sizeZ) { - contents = new Schematic[sizeX][sizeY][sizeZ]; + contents = new SchematicBlockBase[sizeX][sizeY][sizeZ]; this.sizeX = sizeX; this.sizeY = sizeY; @@ -52,7 +52,7 @@ public abstract class BlueprintBase { } public void rotateLeft(BptContext context) { - Schematic newContents[][][] = new Schematic[sizeZ][sizeY][sizeX]; + SchematicBlockBase newContents[][][] = new SchematicBlockBase[sizeZ][sizeY][sizeX]; for (int x = 0; x < sizeZ; ++x) { for (int y = 0; y < sizeY; ++y) { @@ -150,7 +150,7 @@ public abstract class BlueprintBase { rotate = true; } - contents = new Schematic [sizeX][sizeY][sizeZ]; + contents = new SchematicBlockBase [sizeX][sizeY][sizeZ]; try { loadContents (nbt); diff --git a/common/buildcraft/core/blueprints/BptBuilderBlueprint.java b/common/buildcraft/core/blueprints/BptBuilderBlueprint.java index f35dc157..a902e691 100644 --- a/common/buildcraft/core/blueprints/BptBuilderBlueprint.java +++ b/common/buildcraft/core/blueprints/BptBuilderBlueprint.java @@ -11,6 +11,7 @@ package buildcraft.core.blueprints; import java.util.Collections; import java.util.Comparator; import java.util.HashMap; +import java.util.Iterator; import java.util.LinkedList; import java.util.ListIterator; import java.util.Map.Entry; @@ -21,6 +22,7 @@ import net.minecraft.item.ItemStack; import net.minecraft.world.World; import net.minecraft.world.WorldSettings.GameType; import buildcraft.api.blueprints.CoordTransformation; +import buildcraft.api.blueprints.Schematic; import buildcraft.api.blueprints.SchematicBlock; import buildcraft.api.blueprints.SchematicEntity; import buildcraft.api.core.StackKey; @@ -138,7 +140,7 @@ public class BptBuilderBlueprint extends BptBuilderBase { } if (entityList.size() != 0) { - BuildingSlot slot = entityList.removeFirst(); + BuildingSlot slot = internalGetNextEntity(world, inv, entityList); checkDone (); if (slot != null) { @@ -185,7 +187,7 @@ public class BptBuilderBlueprint extends BptBuilderBase { } else { if (BlockUtil.isSoftBlock(world, slot.x, slot.y, slot.z) && checkRequirements(builder, - (SchematicBlock) slot.schematic)) { + slot.schematic)) { useRequirements(builder, slot); iterator.remove(); @@ -201,11 +203,26 @@ public class BptBuilderBlueprint extends BptBuilderBase { return null; } - public boolean checkRequirements(TileAbstractBuilder builder, SchematicBlock slot) { - if (slot.block == null) { - return true; + private BuildingSlot internalGetNextEntity(World world, + TileAbstractBuilder builder, LinkedList list) { + Iterator it = list.iterator(); + + while (iterator.hasNext()) { + BuildingSlotEntity slot = it.next(); + + if (checkRequirements(builder, slot.schematic)) { + useRequirements(builder, slot); + + iterator.remove(); + postProcessing.add(slot); + return slot; + } } + return null; + } + + public boolean checkRequirements(TileAbstractBuilder builder, Schematic slot) { double energyRequired = 0; LinkedList tmpReq = new LinkedList(); @@ -268,7 +285,7 @@ public class BptBuilderBlueprint extends BptBuilderBase { return true; } - public void useRequirements(TileAbstractBuilder builder, BuildingSlotBlock slot) { + public void useRequirements(TileAbstractBuilder builder, BuildingSlot slot) { LinkedList tmpReq = new LinkedList(); double energyRequired = 0; @@ -377,6 +394,35 @@ public class BptBuilderBlueprint extends BptBuilderBase { BCLog.logger.throwing("BptBuilderBlueprint", "recomputeIfNeeded", t); } + for (ItemStack stack : stacks) { + if (stack == null || stack.getItem() == null || stack.stackSize == 0) { + continue; + } + + StackKey key = new StackKey(stack); + + if (!computeStacks.containsKey(key)) { + computeStacks.put(key, stack.stackSize); + } else { + Integer num = computeStacks.get(key); + num += stack.stackSize; + + computeStacks.put(key, num); + } + } + } + + for (BuildingSlotEntity slot : entityList) { + LinkedList stacks = new LinkedList(); + + try { + stacks = slot.getRequirements(context); + } catch (Throwable t) { + // Defensive code against errors in implementers + t.printStackTrace(); + BCLog.logger.throwing("BptBuilderBlueprint", "recomputeIfNeeded", t); + } + for (ItemStack stack : stacks) { if (stack == null || stack.getItem() == null || stack.stackSize == 0) { continue; @@ -402,7 +448,6 @@ public class BptBuilderBlueprint extends BptBuilderBase { neededItems.add(newStack); } - LinkedList sortedList = new LinkedList (); for (ItemStack toInsert : neededItems) { diff --git a/common/buildcraft/core/blueprints/BptBuilderTemplate.java b/common/buildcraft/core/blueprints/BptBuilderTemplate.java index 8b6d849a..498fd93f 100644 --- a/common/buildcraft/core/blueprints/BptBuilderTemplate.java +++ b/common/buildcraft/core/blueprints/BptBuilderTemplate.java @@ -13,7 +13,7 @@ import java.util.LinkedList; import net.minecraft.item.ItemStack; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; -import buildcraft.api.blueprints.Schematic; +import buildcraft.api.blueprints.SchematicBlockBase; import buildcraft.builders.TileAbstractBuilder; import buildcraft.core.blueprints.BuildingSlotBlock.Mode; import buildcraft.core.inventory.InventoryIterator; @@ -35,7 +35,7 @@ public class BptBuilderTemplate extends BptBuilderBase { int yCoord = j + y - blueprint.anchorY; int zCoord = k + z - blueprint.anchorZ; - Schematic slot = bluePrint.contents[i][j][k]; + SchematicBlockBase slot = bluePrint.contents[i][j][k]; if (slot == null) { BuildingSlotBlock b = new BuildingSlotBlock(); @@ -59,7 +59,7 @@ public class BptBuilderTemplate extends BptBuilderBase { int yCoord = j + y - blueprint.anchorY; int zCoord = k + z - blueprint.anchorZ; - Schematic slot = bluePrint.contents[i][j][k]; + SchematicBlockBase slot = bluePrint.contents[i][j][k]; if (slot != null) { BuildingSlotBlock b = new BuildingSlotBlock(); diff --git a/common/buildcraft/core/blueprints/BuildingSlot.java b/common/buildcraft/core/blueprints/BuildingSlot.java index e2be4329..74dcc448 100755 --- a/common/buildcraft/core/blueprints/BuildingSlot.java +++ b/common/buildcraft/core/blueprints/BuildingSlot.java @@ -12,6 +12,7 @@ import java.util.LinkedList; import net.minecraft.item.ItemStack; import buildcraft.api.blueprints.IBuilderContext; +import buildcraft.api.blueprints.Schematic; import buildcraft.api.core.Position; public abstract class BuildingSlot { @@ -43,4 +44,6 @@ public abstract class BuildingSlot { stackConsumed.add (stack); } + + public abstract Schematic getSchematic (); } diff --git a/common/buildcraft/core/blueprints/BuildingSlotBlock.java b/common/buildcraft/core/blueprints/BuildingSlotBlock.java index 95924d10..d92e2b9d 100755 --- a/common/buildcraft/core/blueprints/BuildingSlotBlock.java +++ b/common/buildcraft/core/blueprints/BuildingSlotBlock.java @@ -13,14 +13,14 @@ import java.util.LinkedList; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import buildcraft.api.blueprints.IBuilderContext; -import buildcraft.api.blueprints.Schematic; +import buildcraft.api.blueprints.SchematicBlockBase; import buildcraft.api.blueprints.SchematicMask; import buildcraft.api.core.Position; public class BuildingSlotBlock extends BuildingSlot implements Comparable { public int x, y, z; - public Schematic schematic; + public SchematicBlockBase schematic; public enum Mode { ClearIfInvalid, Build @@ -28,7 +28,8 @@ public class BuildingSlotBlock extends BuildingSlot implements Comparable getRequirements (IBuilderContext context) { + LinkedList results = new LinkedList(); + + for (ItemStack s : schematic.storedRequirements) { + results.add(s); + } + + return results; + } + + @Override + public SchematicEntity getSchematic() { + return schematic; + } }