further work on #2045
This commit is contained in:
parent
24a02a5b17
commit
57e8829266
35 changed files with 84 additions and 57 deletions
|
@ -114,17 +114,17 @@ import buildcraft.core.DefaultProps;
|
|||
import buildcraft.core.InterModComms;
|
||||
import buildcraft.core.Version;
|
||||
import buildcraft.core.blueprints.RealBlueprintDeployer;
|
||||
import buildcraft.core.blueprints.patterns.FillerPattern;
|
||||
import buildcraft.core.blueprints.patterns.FillerRegistry;
|
||||
import buildcraft.core.blueprints.patterns.PatternBox;
|
||||
import buildcraft.core.blueprints.patterns.PatternClear;
|
||||
import buildcraft.core.blueprints.patterns.PatternCylinder;
|
||||
import buildcraft.core.blueprints.patterns.PatternFill;
|
||||
import buildcraft.core.blueprints.patterns.PatternFlatten;
|
||||
import buildcraft.core.blueprints.patterns.PatternFrame;
|
||||
import buildcraft.core.blueprints.patterns.PatternHorizon;
|
||||
import buildcraft.core.blueprints.patterns.PatternPyramid;
|
||||
import buildcraft.core.blueprints.patterns.PatternStairs;
|
||||
import buildcraft.core.builders.patterns.FillerPattern;
|
||||
import buildcraft.core.builders.patterns.FillerRegistry;
|
||||
import buildcraft.core.builders.patterns.PatternBox;
|
||||
import buildcraft.core.builders.patterns.PatternClear;
|
||||
import buildcraft.core.builders.patterns.PatternCylinder;
|
||||
import buildcraft.core.builders.patterns.PatternFill;
|
||||
import buildcraft.core.builders.patterns.PatternFlatten;
|
||||
import buildcraft.core.builders.patterns.PatternFrame;
|
||||
import buildcraft.core.builders.patterns.PatternHorizon;
|
||||
import buildcraft.core.builders.patterns.PatternPyramid;
|
||||
import buildcraft.core.builders.patterns.PatternStairs;
|
||||
import buildcraft.core.proxy.CoreProxy;
|
||||
import buildcraft.core.science.TechnoSimpleItem;
|
||||
import buildcraft.core.science.Tier;
|
||||
|
|
|
@ -20,6 +20,7 @@ import net.minecraft.item.ItemStack;
|
|||
import net.minecraft.tileentity.TileEntity;
|
||||
import buildcraft.core.EntityLaser;
|
||||
import buildcraft.core.render.RenderBoxProvider;
|
||||
import buildcraft.core.render.RenderBuildingItems;
|
||||
import buildcraft.core.render.RenderLaser;
|
||||
|
||||
public class RenderConstructionMarker extends RenderBoxProvider {
|
||||
|
|
|
@ -46,7 +46,7 @@ import buildcraft.core.blueprints.BptBuilderBase;
|
|||
import buildcraft.core.blueprints.BptBuilderBlueprint;
|
||||
import buildcraft.core.blueprints.BptBuilderTemplate;
|
||||
import buildcraft.core.blueprints.RecursiveBlueprintBuilder;
|
||||
import buildcraft.core.blueprints.TileAbstractBuilder;
|
||||
import buildcraft.core.builders.TileAbstractBuilder;
|
||||
import buildcraft.core.fluids.Tank;
|
||||
import buildcraft.core.fluids.TankManager;
|
||||
import buildcraft.core.inventory.ITransactor;
|
||||
|
|
|
@ -27,8 +27,8 @@ import buildcraft.core.blueprints.BlueprintBase;
|
|||
import buildcraft.core.blueprints.BptBuilderBase;
|
||||
import buildcraft.core.blueprints.BptBuilderBlueprint;
|
||||
import buildcraft.core.blueprints.BptContext;
|
||||
import buildcraft.core.blueprints.BuildingItem;
|
||||
import buildcraft.core.blueprints.IBuildingItemsProvider;
|
||||
import buildcraft.core.builders.BuildingItem;
|
||||
import buildcraft.core.builders.IBuildingItemsProvider;
|
||||
import buildcraft.core.network.RPC;
|
||||
import buildcraft.core.network.RPCHandler;
|
||||
import buildcraft.core.network.RPCMessageInfo;
|
||||
|
|
|
@ -26,9 +26,9 @@ import buildcraft.core.Box.Kind;
|
|||
import buildcraft.core.IMachine;
|
||||
import buildcraft.core.blueprints.BptBuilderTemplate;
|
||||
import buildcraft.core.blueprints.BptContext;
|
||||
import buildcraft.core.blueprints.TileAbstractBuilder;
|
||||
import buildcraft.core.blueprints.patterns.FillerPattern;
|
||||
import buildcraft.core.blueprints.patterns.PatternFill;
|
||||
import buildcraft.core.builders.TileAbstractBuilder;
|
||||
import buildcraft.core.builders.patterns.FillerPattern;
|
||||
import buildcraft.core.builders.patterns.PatternFill;
|
||||
import buildcraft.core.inventory.SimpleInventory;
|
||||
import buildcraft.core.network.PacketPayload;
|
||||
import buildcraft.core.network.PacketUpdate;
|
||||
|
|
|
@ -14,7 +14,7 @@ import net.minecraft.util.ResourceLocation;
|
|||
import buildcraft.api.filler.FillerManager;
|
||||
import buildcraft.builders.TileFiller;
|
||||
import buildcraft.core.DefaultProps;
|
||||
import buildcraft.core.blueprints.patterns.FillerPattern;
|
||||
import buildcraft.core.builders.patterns.FillerPattern;
|
||||
import buildcraft.core.gui.GuiBuildCraft;
|
||||
import buildcraft.core.gui.GuiTools;
|
||||
import buildcraft.core.gui.buttons.GuiBetterButton;
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
package buildcraft.builders.triggers;
|
||||
|
||||
import net.minecraft.util.IIcon;
|
||||
import buildcraft.core.blueprints.patterns.FillerPattern;
|
||||
import buildcraft.core.builders.patterns.FillerPattern;
|
||||
import buildcraft.core.triggers.BCActionPassive;
|
||||
|
||||
public class ActionFiller extends BCActionPassive {
|
||||
|
|
|
@ -9,19 +9,22 @@
|
|||
package buildcraft.builders.triggers;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedList;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
import buildcraft.api.filler.FillerManager;
|
||||
import buildcraft.api.filler.IFillerPattern;
|
||||
import buildcraft.api.gates.IAction;
|
||||
import buildcraft.api.gates.IActionProvider;
|
||||
import buildcraft.api.transport.IPipeTile;
|
||||
import buildcraft.builders.TileFiller;
|
||||
import buildcraft.core.builders.patterns.FillerPattern;
|
||||
|
||||
public class BuildersActionProvider implements IActionProvider {
|
||||
|
||||
private final HashMap<String, ActionFiller> actionMap = new HashMap<String, ActionFiller>();
|
||||
|
||||
@Override
|
||||
public Collection<IAction> getPipeActions(IPipeTile pipe) {
|
||||
return null;
|
||||
|
@ -31,7 +34,14 @@ public class BuildersActionProvider implements IActionProvider {
|
|||
public Collection<IAction> getNeighborActions(Block block, TileEntity tile) {
|
||||
LinkedList<IAction> actions = new LinkedList<IAction>();
|
||||
if (tile instanceof TileFiller) {
|
||||
actions.addAll(FillerManager.registry.getActions());
|
||||
for(IFillerPattern p : FillerManager.registry.getPatterns()) {
|
||||
if (p instanceof FillerPattern) {
|
||||
if (!actionMap.containsKey(p.getUniqueTag())) {
|
||||
actionMap.put(p.getUniqueTag(), new ActionFiller((FillerPattern) p));
|
||||
}
|
||||
actions.add(actionMap.get(p.getUniqueTag()));
|
||||
}
|
||||
}
|
||||
}
|
||||
return actions;
|
||||
}
|
||||
|
|
|
@ -20,7 +20,7 @@ import cpw.mods.fml.relauncher.SideOnly;
|
|||
import buildcraft.api.filler.IFillerPattern;
|
||||
import buildcraft.core.Box;
|
||||
import buildcraft.core.DefaultProps;
|
||||
import buildcraft.core.blueprints.patterns.FillerPattern;
|
||||
import buildcraft.core.builders.patterns.FillerPattern;
|
||||
import buildcraft.core.gui.AdvancedSlot;
|
||||
import buildcraft.core.gui.GuiAdvancedInterface;
|
||||
|
||||
|
|
|
@ -30,6 +30,11 @@ import buildcraft.api.core.BlockIndex;
|
|||
import buildcraft.api.core.IAreaProvider;
|
||||
import buildcraft.api.core.Position;
|
||||
import buildcraft.core.Box;
|
||||
import buildcraft.core.builders.BuildingItem;
|
||||
import buildcraft.core.builders.BuildingSlot;
|
||||
import buildcraft.core.builders.BuildingSlotBlock;
|
||||
import buildcraft.core.builders.IBuildingItemsProvider;
|
||||
import buildcraft.core.builders.TileAbstractBuilder;
|
||||
|
||||
public abstract class BptBuilderBase implements IAreaProvider {
|
||||
|
||||
|
|
|
@ -41,7 +41,13 @@ import buildcraft.api.core.BuildCraftAPI;
|
|||
import buildcraft.api.core.IInvSlot;
|
||||
import buildcraft.api.core.StackKey;
|
||||
import buildcraft.builders.TileBuilder;
|
||||
import buildcraft.core.blueprints.BuildingSlotBlock.Mode;
|
||||
import buildcraft.core.builders.BuildingSlot;
|
||||
import buildcraft.core.builders.BuildingSlotBlock;
|
||||
import buildcraft.core.builders.BuildingSlotEntity;
|
||||
import buildcraft.core.builders.BuildingSlotIterator;
|
||||
import buildcraft.core.builders.IBuildingItemsProvider;
|
||||
import buildcraft.core.builders.TileAbstractBuilder;
|
||||
import buildcraft.core.builders.BuildingSlotBlock.Mode;
|
||||
import buildcraft.core.inventory.InventoryCopy;
|
||||
import buildcraft.core.inventory.InventoryIterator;
|
||||
import buildcraft.core.inventory.StackHelper;
|
||||
|
|
|
@ -18,7 +18,11 @@ import buildcraft.api.blueprints.SchematicRegistry;
|
|||
import buildcraft.api.core.BlockIndex;
|
||||
import buildcraft.api.core.BuildCraftAPI;
|
||||
import buildcraft.api.core.IInvSlot;
|
||||
import buildcraft.core.blueprints.BuildingSlotBlock.Mode;
|
||||
import buildcraft.core.builders.BuildingSlot;
|
||||
import buildcraft.core.builders.BuildingSlotBlock;
|
||||
import buildcraft.core.builders.BuildingSlotIterator;
|
||||
import buildcraft.core.builders.TileAbstractBuilder;
|
||||
import buildcraft.core.builders.BuildingSlotBlock.Mode;
|
||||
import buildcraft.core.inventory.InventoryIterator;
|
||||
import buildcraft.core.utils.BlockUtil;
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
* 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.core.blueprints;
|
||||
package buildcraft.core.builders;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.LinkedList;
|
|
@ -6,7 +6,7 @@
|
|||
* 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.core.blueprints;
|
||||
package buildcraft.core.builders;
|
||||
|
||||
import java.util.LinkedList;
|
||||
|
|
@ -6,7 +6,7 @@
|
|||
* 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.core.blueprints;
|
||||
package buildcraft.core.builders;
|
||||
|
||||
import java.util.LinkedList;
|
||||
|
|
@ -6,7 +6,7 @@
|
|||
* 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.core.blueprints;
|
||||
package buildcraft.core.builders;
|
||||
|
||||
import java.util.LinkedList;
|
||||
|
|
@ -6,7 +6,7 @@
|
|||
* 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.core.blueprints;
|
||||
package buildcraft.core.builders;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedList;
|
|
@ -6,7 +6,7 @@
|
|||
* 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.core.blueprints;
|
||||
package buildcraft.core.builders;
|
||||
|
||||
public interface IBuildingItem {
|
||||
boolean isDone();
|
|
@ -6,7 +6,7 @@
|
|||
* 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.core.blueprints;
|
||||
package buildcraft.core.builders;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
|
@ -6,7 +6,7 @@
|
|||
* 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.core.blueprints;
|
||||
package buildcraft.core.builders;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedList;
|
|
@ -6,7 +6,7 @@
|
|||
* 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.core.blueprints.patterns;
|
||||
package buildcraft.core.builders.patterns;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.TreeMap;
|
|
@ -6,13 +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.core.blueprints.patterns;
|
||||
package buildcraft.core.builders.patterns;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.Set;
|
||||
import java.util.TreeMap;
|
||||
|
||||
import com.google.common.collect.Sets;
|
||||
|
||||
import buildcraft.api.filler.IFillerPattern;
|
||||
import buildcraft.api.filler.IFillerRegistry;
|
||||
import buildcraft.builders.triggers.ActionFiller;
|
||||
|
@ -20,12 +24,10 @@ import buildcraft.builders.triggers.ActionFiller;
|
|||
public class FillerRegistry implements IFillerRegistry {
|
||||
|
||||
private TreeMap<String, IFillerPattern> patterns = new TreeMap<String, IFillerPattern>();
|
||||
private Set<ActionFiller> patternActions = new HashSet<ActionFiller>();
|
||||
|
||||
@Override
|
||||
public void addPattern(IFillerPattern pattern) {
|
||||
patterns.put(pattern.getUniqueTag(), pattern);
|
||||
patternActions.add(new ActionFiller((FillerPattern) pattern));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -52,7 +54,7 @@ public class FillerRegistry implements IFillerRegistry {
|
|||
}
|
||||
|
||||
@Override
|
||||
public Set<ActionFiller> getActions() {
|
||||
return patternActions;
|
||||
public Collection<IFillerPattern> getPatterns() {
|
||||
return Collections.unmodifiableCollection(patterns.values());
|
||||
}
|
||||
}
|
|
@ -6,7 +6,7 @@
|
|||
* 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.core.blueprints.patterns;
|
||||
package buildcraft.core.builders.patterns;
|
||||
|
||||
import net.minecraft.world.World;
|
||||
import buildcraft.core.Box;
|
|
@ -6,7 +6,7 @@
|
|||
* 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.core.blueprints.patterns;
|
||||
package buildcraft.core.builders.patterns;
|
||||
|
||||
import net.minecraft.world.World;
|
||||
import buildcraft.core.Box;
|
|
@ -6,7 +6,7 @@
|
|||
* 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.core.blueprints.patterns;
|
||||
package buildcraft.core.builders.patterns;
|
||||
|
||||
import net.minecraft.world.World;
|
||||
import buildcraft.core.Box;
|
|
@ -6,7 +6,7 @@
|
|||
* 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.core.blueprints.patterns;
|
||||
package buildcraft.core.builders.patterns;
|
||||
|
||||
import net.minecraft.world.World;
|
||||
|
|
@ -6,7 +6,7 @@
|
|||
* 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.core.blueprints.patterns;
|
||||
package buildcraft.core.builders.patterns;
|
||||
|
||||
import net.minecraft.world.World;
|
||||
import buildcraft.api.blueprints.SchematicMask;
|
|
@ -6,7 +6,7 @@
|
|||
* 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.core.blueprints.patterns;
|
||||
package buildcraft.core.builders.patterns;
|
||||
|
||||
import net.minecraft.world.World;
|
||||
import buildcraft.api.blueprints.SchematicMask;
|
|
@ -6,7 +6,7 @@
|
|||
* 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.core.blueprints.patterns;
|
||||
package buildcraft.core.builders.patterns;
|
||||
|
||||
import net.minecraft.world.World;
|
||||
import buildcraft.api.blueprints.SchematicMask;
|
|
@ -6,7 +6,7 @@
|
|||
* 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.core.blueprints.patterns;
|
||||
package buildcraft.core.builders.patterns;
|
||||
|
||||
import net.minecraft.world.World;
|
||||
|
|
@ -6,7 +6,7 @@
|
|||
* 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.core.blueprints.patterns;
|
||||
package buildcraft.core.builders.patterns;
|
||||
|
||||
import net.minecraft.world.World;
|
||||
|
|
@ -12,10 +12,9 @@ import org.lwjgl.opengl.GL11;
|
|||
|
||||
import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import buildcraft.builders.RenderBuildingItems;
|
||||
import buildcraft.core.EntityLaser;
|
||||
import buildcraft.core.LaserData;
|
||||
import buildcraft.core.blueprints.TileAbstractBuilder;
|
||||
import buildcraft.core.builders.TileAbstractBuilder;
|
||||
|
||||
public class RenderBuilder extends RenderBoxProvider {
|
||||
|
||||
|
|
|
@ -6,13 +6,13 @@
|
|||
* 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.builders;
|
||||
package buildcraft.core.render;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import buildcraft.core.StackAtPosition;
|
||||
import buildcraft.core.blueprints.BuildingItem;
|
||||
import buildcraft.core.blueprints.IBuildingItemsProvider;
|
||||
import buildcraft.core.builders.BuildingItem;
|
||||
import buildcraft.core.builders.IBuildingItemsProvider;
|
||||
import net.minecraft.client.renderer.entity.RenderItem;
|
||||
import net.minecraft.client.renderer.entity.RenderManager;
|
||||
import net.minecraft.entity.item.EntityItem;
|
|
@ -17,8 +17,8 @@ import buildcraft.api.boards.RedstoneBoardRobotNBT;
|
|||
import buildcraft.api.robots.AIRobot;
|
||||
import buildcraft.api.robots.EntityRobotBase;
|
||||
import buildcraft.builders.TileConstructionMarker;
|
||||
import buildcraft.core.blueprints.BuildingItem;
|
||||
import buildcraft.core.blueprints.BuildingSlot;
|
||||
import buildcraft.core.builders.BuildingItem;
|
||||
import buildcraft.core.builders.BuildingSlot;
|
||||
import buildcraft.core.inventory.filters.ArrayStackFilter;
|
||||
import buildcraft.core.robots.AIRobotGotoBlock;
|
||||
import buildcraft.core.robots.AIRobotGotoSleep;
|
||||
|
|
|
@ -45,8 +45,8 @@ import buildcraft.core.IMachine;
|
|||
import buildcraft.core.blueprints.Blueprint;
|
||||
import buildcraft.core.blueprints.BptBuilderBase;
|
||||
import buildcraft.core.blueprints.BptBuilderBlueprint;
|
||||
import buildcraft.core.blueprints.TileAbstractBuilder;
|
||||
import buildcraft.core.blueprints.patterns.FillerPattern;
|
||||
import buildcraft.core.builders.TileAbstractBuilder;
|
||||
import buildcraft.core.builders.patterns.FillerPattern;
|
||||
import buildcraft.core.network.PacketUpdate;
|
||||
import buildcraft.core.proxy.CoreProxy;
|
||||
import buildcraft.core.utils.BlockUtil;
|
||||
|
|
Loading…
Reference in a new issue