diff --git a/api/buildcraft/api/blueprints/SchematicRegistry.java b/api/buildcraft/api/blueprints/SchematicRegistry.java index 0bbfcf6a..8e7754a9 100644 --- a/api/buildcraft/api/blueprints/SchematicRegistry.java +++ b/api/buildcraft/api/blueprints/SchematicRegistry.java @@ -31,14 +31,11 @@ public final class SchematicRegistry { public static int BREAK_ENERGY = 100; public static final int BUILD_ENERGY = 200; - private static final HashSet explicitSchematicBlocks = new HashSet(); - private static final HashMap schematicBlocks = new HashMap(); private static final HashMap, SchematicConstructor> schematicEntities = new HashMap, SchematicConstructor>(); - private static final HashSet modsSupporting = new HashSet(); private static final HashSet modsForbidden = new HashSet(); private static final HashSet blocksForbidden = new HashSet(); @@ -97,11 +94,6 @@ public final class SchematicRegistry { } public static void registerSchematicBlock(Block block, Class clazz, Object... params) { - explicitSchematicBlocks.add(block); - internalRegisterSchematicBlock(block, clazz, params); - } - - private static void internalRegisterSchematicBlock(Block block, Class clazz, Object... params) { if (schematicBlocks.containsKey(block)) { throw new RuntimeException("Block " + Block.blockRegistry.getNameForObject(block) + " is already associated with a schematic."); } @@ -123,16 +115,7 @@ public final class SchematicRegistry { } if (!schematicBlocks.containsKey(block)) { - if (block instanceof ITileEntityProvider) { - internalRegisterSchematicBlock(block, SchematicTile.class); - } else { - Fluid fluid = FluidRegistry.lookupFluidForBlock(block); - if (fluid != null) { - internalRegisterSchematicBlock(block, SchematicFluid.class, new FluidStack(fluid, FluidContainerRegistry.BUCKET_VOLUME)); - } else { - internalRegisterSchematicBlock(block, SchematicBlock.class); - } - } + return null; } try { @@ -176,17 +159,13 @@ public final class SchematicRegistry { return null; } - public static void declareBlueprintSupport(String modid) { - modsSupporting.add(modid); - } - - public static boolean isExplicitlySupported(Block block) { - return explicitSchematicBlocks.contains(block) || modsSupporting.contains(Block.blockRegistry.getNameForObject(block).split(":", 2)[0]); + public static boolean isSupported(Block block) { + return schematicBlocks.containsKey(block); } public static boolean isAllowedForBuilding(Block block) { String name = Block.blockRegistry.getNameForObject(block); - return !blocksForbidden.contains(name) && !modsForbidden.contains(name.split(":", 2)[0]); + return isSupported(block) && !blocksForbidden.contains(name) && !modsForbidden.contains(name.split(":", 2)[0]); } public static void readConfiguration(Configuration conf) { @@ -211,8 +190,4 @@ public final class SchematicRegistry { } } } - - static { - modsSupporting.add("minecraft"); - } } diff --git a/common/buildcraft/BuildCraftBuilders.java b/common/buildcraft/BuildCraftBuilders.java index 6656d461..e0f27e6e 100644 --- a/common/buildcraft/BuildCraftBuilders.java +++ b/common/buildcraft/BuildCraftBuilders.java @@ -236,8 +236,6 @@ public class BuildCraftBuilders extends BuildCraftMod { @Mod.EventHandler public void init(FMLInitializationEvent evt) { - SchematicRegistry.declareBlueprintSupport("BuildCraft|Builders"); - // Register gui handler NetworkRegistry.INSTANCE.registerGuiHandler(instance, new GuiHandler()); diff --git a/common/buildcraft/BuildCraftCore.java b/common/buildcraft/BuildCraftCore.java index 808a6c31..06a621ae 100644 --- a/common/buildcraft/BuildCraftCore.java +++ b/common/buildcraft/BuildCraftCore.java @@ -241,8 +241,6 @@ public class BuildCraftCore extends BuildCraftMod { @Mod.EventHandler public void loadConfiguration(FMLPreInitializationEvent evt) { - SchematicRegistry.declareBlueprintSupport("BuildCraft|Core"); - BCLog.initLog(); BuildcraftRecipeRegistry.assemblyTable = AssemblyRecipeManager.INSTANCE; diff --git a/common/buildcraft/BuildCraftEnergy.java b/common/buildcraft/BuildCraftEnergy.java index 12ae99b3..06663431 100644 --- a/common/buildcraft/BuildCraftEnergy.java +++ b/common/buildcraft/BuildCraftEnergy.java @@ -122,8 +122,6 @@ public class BuildCraftEnergy extends BuildCraftMod { @Mod.EventHandler public void preInit(FMLPreInitializationEvent evt) { - SchematicRegistry.declareBlueprintSupport("BuildCraft|Energy"); - int oilDesertBiomeId = BuildCraftCore.mainConfiguration.get("biomes", "biomeOilDesert", DefaultProps.BIOME_OIL_DESERT).getInt(DefaultProps.BIOME_OIL_DESERT); int oilOceanBiomeId = BuildCraftCore.mainConfiguration.get("biomes", "biomeOilOcean", DefaultProps.BIOME_OIL_OCEAN).getInt(DefaultProps.BIOME_OIL_OCEAN); canOilBurn = BuildCraftCore.mainConfiguration.get(Configuration.CATEGORY_GENERAL, "burnOil", true, "Can oil burn?").getBoolean(true); diff --git a/common/buildcraft/BuildCraftFactory.java b/common/buildcraft/BuildCraftFactory.java index 62c6326a..fc50da0d 100644 --- a/common/buildcraft/BuildCraftFactory.java +++ b/common/buildcraft/BuildCraftFactory.java @@ -134,8 +134,6 @@ public class BuildCraftFactory extends BuildCraftMod { @Mod.EventHandler public void load(FMLInitializationEvent evt) { - SchematicRegistry.declareBlueprintSupport("BuildCraft|Factory"); - NetworkRegistry.INSTANCE.registerGuiHandler(instance, new GuiHandler()); // EntityRegistry.registerModEntity(EntityMechanicalArm.class, "bcMechanicalArm", EntityIds.MECHANICAL_ARM, instance, 50, 1, true); diff --git a/common/buildcraft/BuildCraftSilicon.java b/common/buildcraft/BuildCraftSilicon.java index 072765e7..5a130e15 100644 --- a/common/buildcraft/BuildCraftSilicon.java +++ b/common/buildcraft/BuildCraftSilicon.java @@ -124,8 +124,6 @@ public class BuildCraftSilicon extends BuildCraftMod { @Mod.EventHandler public void preInit(FMLPreInitializationEvent evt) { - SchematicRegistry.declareBlueprintSupport("BuildCraft|Silicon"); - BuildCraftCore.mainConfiguration.save(); laserBlock = new BlockLaser(); diff --git a/common/buildcraft/BuildCraftTransport.java b/common/buildcraft/BuildCraftTransport.java index 9345048b..cb1d20b2 100644 --- a/common/buildcraft/BuildCraftTransport.java +++ b/common/buildcraft/BuildCraftTransport.java @@ -272,8 +272,6 @@ public class BuildCraftTransport extends BuildCraftMod { @Mod.EventHandler public void preInit(FMLPreInitializationEvent evt) { - SchematicRegistry.declareBlueprintSupport("BuildCraft|Transport"); - try { Property durability = BuildCraftCore.mainConfiguration.get(Configuration.CATEGORY_GENERAL, "pipes.durability", DefaultProps.PIPES_DURABILITY); durability.comment = "How long a pipe will take to break"; diff --git a/common/buildcraft/builders/gui/GuiArchitect.java b/common/buildcraft/builders/gui/GuiArchitect.java index 9cd84584..53d9ce7c 100644 --- a/common/buildcraft/builders/gui/GuiArchitect.java +++ b/common/buildcraft/builders/gui/GuiArchitect.java @@ -37,10 +37,7 @@ public class GuiArchitect extends GuiBuildCraft { private TileArchitect architect; private GuiButton optionRotate; - private GuiButton optionReadMods; - private GuiButton optionReadBlocks; private GuiButton optionExcavate; - private GuiButton optionExplicit; private GuiTextField textField; @@ -61,15 +58,9 @@ public class GuiArchitect extends GuiBuildCraft { optionRotate = new GuiButton(0, guiLeft + 5, guiTop + 30, 77, 20, ""); buttonList.add(optionRotate); - optionReadBlocks = new GuiButton(1, guiLeft + 5, guiTop + 55, 77, 20, ""); - buttonList.add(optionReadBlocks); - - optionExcavate = new GuiButton(2, guiLeft + 5, guiTop + 80, 77, 20, ""); + optionExcavate = new GuiButton(1, guiLeft + 5, guiTop + 55, 77, 20, ""); buttonList.add(optionExcavate); - optionExplicit = new GuiButton(3, guiLeft + 5, guiTop + 105, 77, 20, ""); - buttonList.add(optionExplicit); - textField = new GuiTextField(this.fontRendererObj, TEXT_X, TEXT_Y, TEXT_WIDTH, TEXT_HEIGHT); textField.setMaxStringLength(BuildCraftBuilders.MAX_BLUEPRINTS_NAME_SIZE); textField.setText(architect.name); @@ -89,12 +80,8 @@ public class GuiArchitect extends GuiBuildCraft { if (button == optionRotate) { conf.rotate = !conf.rotate; - } else if (button == optionReadBlocks) { - conf.readTiles = !conf.readTiles; } else if (button == optionExcavate) { conf.excavate = !conf.excavate; - } else if (button == optionExplicit) { - conf.explicitOnly = !conf.explicitOnly; } architect.rpcSetConfiguration(conf); @@ -111,23 +98,11 @@ public class GuiArchitect extends GuiBuildCraft { optionRotate.displayString = StringUtils.localize("tile.architect.norotate"); } - if (conf.readTiles) { - optionReadBlocks.displayString = StringUtils.localize("tile.architect.allblocks"); - } else { - optionReadBlocks.displayString = StringUtils.localize("tile.architect.simpleblocks"); - } - if (conf.excavate) { optionExcavate.displayString = StringUtils.localize("tile.architect.excavate"); } else { optionExcavate.displayString = StringUtils.localize("tile.architect.noexcavate"); } - - if (conf.explicitOnly) { - optionExplicit.displayString = StringUtils.localize("tile.architect.supportmods"); - } else { - optionExplicit.displayString = StringUtils.localize("tile.architect.allmods"); - } } @Override diff --git a/common/buildcraft/core/blueprints/Blueprint.java b/common/buildcraft/core/blueprints/Blueprint.java index f94fe850..c185f413 100644 --- a/common/buildcraft/core/blueprints/Blueprint.java +++ b/common/buildcraft/core/blueprints/Blueprint.java @@ -98,11 +98,7 @@ public class Blueprint extends BlueprintBase { slot.block = block; slot.meta = anchorTile.getWorldObj().getBlockMetadata(x, y, z); - if (bptContext.readConfiguration.explicitOnly && !SchematicRegistry.isExplicitlySupported(block)) { - return; - } - - if (!bptContext.readConfiguration.readTiles && anchorTile.getWorldObj().getTileEntity(x, y, z) != null) { + if (!SchematicRegistry.isSupported(block)) { return; } diff --git a/common/buildcraft/core/blueprints/BlueprintReadConfiguration.java b/common/buildcraft/core/blueprints/BlueprintReadConfiguration.java index 8685cdd9..803ef593 100755 --- a/common/buildcraft/core/blueprints/BlueprintReadConfiguration.java +++ b/common/buildcraft/core/blueprints/BlueprintReadConfiguration.java @@ -16,27 +16,17 @@ public class BlueprintReadConfiguration { @NetworkData public boolean rotate = true; - @NetworkData - public boolean readTiles = true; - @NetworkData public boolean excavate = true; - @NetworkData - public boolean explicitOnly = false; - public void writeToNBT(NBTTagCompound nbttagcompound) { nbttagcompound.setBoolean("rotate", rotate); - nbttagcompound.setBoolean("readAllBlocks", readTiles); nbttagcompound.setBoolean("excavate", excavate); - nbttagcompound.setBoolean("explicitOnly", explicitOnly); } public void readFromNBT(NBTTagCompound nbttagcompound) { rotate = nbttagcompound.getBoolean("rotate"); - readTiles = nbttagcompound.getBoolean("readAllBlocks"); excavate = nbttagcompound.getBoolean("excavate"); - explicitOnly = nbttagcompound.getBoolean("explicitOnly"); } } diff --git a/common/buildcraft/transport/pipes/PipeItemsStripes.java b/common/buildcraft/transport/pipes/PipeItemsStripes.java index b523a084..dbc90ae0 100755 --- a/common/buildcraft/transport/pipes/PipeItemsStripes.java +++ b/common/buildcraft/transport/pipes/PipeItemsStripes.java @@ -131,10 +131,12 @@ public class PipeItemsStripes extends Pipe implements IEnerg stack.stackSize++; getWorld().setBlockToAir((int) p.x, (int) p.y, (int) p.z); } + BuildCraftTransport.pipeItemsStripes.onItemUse(new ItemStack( - BuildCraftTransport.pipeItemsStripes), player, getWorld(), (int) p.x, + BuildCraftTransport.pipeItemsStripes, 1, this.container.glassColor), player, getWorld(), (int) p.x, (int) p.y, (int) p.z, 1, 0, 0, 0 ); + this.container.glassColor = stack.getItemDamage() - 1; if (stack.stackSize > 0) { TileEntity targetTile = getWorld().getTileEntity((int) p.x, (int) p.y, (int) p.z); @@ -145,7 +147,7 @@ public class PipeItemsStripes extends Pipe implements IEnerg new ItemStack(BuildCraftTransport.pipeItemsStripes)), container.zCoord + 0.5, stack.copy()); ((PipeTransportItems) ((TileGenericPipe) targetTile).pipe.transport).injectItem(newItem, event.direction.getOpposite()); - + stack.stackSize = 0; } } @@ -190,7 +192,7 @@ public class PipeItemsStripes extends Pipe implements IEnerg Pipe newPipe = BlockGenericPipe.createPipe(item.getItemStack().getItem()); newPipe.setTile(this.container); this.container.pipe = newPipe; - + item.getItemStack().stackSize--; if (item.getItemStack().stackSize <= 0) {