diff --git a/common/buildcraft/BuildCraftBuilders.java b/common/buildcraft/BuildCraftBuilders.java index 788f8544..6141dcd5 100644 --- a/common/buildcraft/BuildCraftBuilders.java +++ b/common/buildcraft/BuildCraftBuilders.java @@ -105,7 +105,6 @@ import buildcraft.builders.schematics.SchematicFire; import buildcraft.builders.schematics.SchematicGlassPane; import buildcraft.builders.schematics.SchematicGravel; import buildcraft.builders.schematics.SchematicHanging; -import buildcraft.builders.schematics.SchematicLever; import buildcraft.builders.schematics.SchematicMinecart; import buildcraft.builders.schematics.SchematicPiston; import buildcraft.builders.schematics.SchematicPortal; @@ -119,6 +118,7 @@ import buildcraft.builders.schematics.SchematicSign; import buildcraft.builders.schematics.SchematicSkull; import buildcraft.builders.schematics.SchematicStairs; import buildcraft.builders.schematics.SchematicStone; +import buildcraft.builders.schematics.SchematicSilverfish; import buildcraft.builders.schematics.SchematicTripWireHook; import buildcraft.builders.statements.BuildersActionProvider; import buildcraft.core.CompatHooks; @@ -134,9 +134,7 @@ import buildcraft.core.builders.schematics.SchematicFree; import buildcraft.core.builders.schematics.SchematicIgnore; import buildcraft.core.builders.schematics.SchematicRotateMeta; import buildcraft.core.builders.schematics.SchematicRotateMetaSupported; -import buildcraft.core.builders.schematics.SchematicStandalone; import buildcraft.core.builders.schematics.SchematicTileCreative; -import buildcraft.core.builders.schematics.SchematicWallSide; import buildcraft.core.config.ConfigManager; import buildcraft.core.proxy.CoreProxy; @@ -365,10 +363,6 @@ public class BuildCraftBuilders extends BuildCraftMod { schemes.registerSchematicBlock(Blocks.melon_stem, SchematicSeeds.class, Items.melon_seeds); schemes.registerSchematicBlock(Blocks.nether_wart, SchematicSeeds.class, Items.nether_wart); - schemes.registerSchematicBlock(Blocks.torch, SchematicWallSide.class); - schemes.registerSchematicBlock(Blocks.redstone_torch, SchematicWallSide.class); - schemes.registerSchematicBlock(Blocks.unlit_redstone_torch, SchematicWallSide.class); - schemes.registerSchematicBlock(Blocks.tripwire, SchematicBlockFloored.class); schemes.registerSchematicBlock(Blocks.tripwire_hook, SchematicTripWireHook.class); @@ -395,13 +389,7 @@ public class BuildCraftBuilders extends BuildCraftMod { schemes.registerSchematicBlock(Blocks.vine, SchematicRotateMeta.class, new int[]{1, 4, 8, 2}, false); schemes.registerSchematicBlock(Blocks.trapdoor, SchematicRotateMeta.class, new int[]{0, 1, 2, 3}, false); - schemes.registerSchematicBlock(Blocks.wooden_button, SchematicLever.class); - schemes.registerSchematicBlock(Blocks.stone_button, SchematicLever.class); - schemes.registerSchematicBlock(Blocks.lever, SchematicLever.class); - schemes.registerSchematicBlock(Blocks.stone, SchematicStone.class); - schemes.registerSchematicBlock(Blocks.gold_ore, SchematicStone.class); - schemes.registerSchematicBlock(Blocks.iron_ore, SchematicStone.class); schemes.registerSchematicBlock(Blocks.coal_ore, SchematicStone.class); schemes.registerSchematicBlock(Blocks.lapis_ore, SchematicStone.class); schemes.registerSchematicBlock(Blocks.diamond_ore, SchematicStone.class); @@ -409,6 +397,8 @@ public class BuildCraftBuilders extends BuildCraftMod { schemes.registerSchematicBlock(Blocks.lit_redstone_ore, SchematicStone.class); schemes.registerSchematicBlock(Blocks.emerald_ore, SchematicStone.class); + schemes.registerSchematicBlock(Blocks.monster_egg, SchematicSilverfish.class); + schemes.registerSchematicBlock(Blocks.gravel, SchematicGravel.class); schemes.registerSchematicBlock(Blocks.redstone_wire, SchematicRedstoneWire.class, new ItemStack(Items.redstone)); @@ -432,19 +422,6 @@ public class BuildCraftBuilders extends BuildCraftMod { schemes.registerSchematicBlock(Blocks.lit_pumpkin, SchematicPumpkin.class); - schemes.registerSchematicBlock(Blocks.oak_stairs, SchematicStairs.class); - schemes.registerSchematicBlock(Blocks.stone_stairs, SchematicStairs.class); - schemes.registerSchematicBlock(Blocks.brick_stairs, SchematicStairs.class); - schemes.registerSchematicBlock(Blocks.stone_brick_stairs, SchematicStairs.class); - schemes.registerSchematicBlock(Blocks.nether_brick_stairs, SchematicStairs.class); - schemes.registerSchematicBlock(Blocks.sandstone_stairs, SchematicStairs.class); - schemes.registerSchematicBlock(Blocks.spruce_stairs, SchematicStairs.class); - schemes.registerSchematicBlock(Blocks.birch_stairs, SchematicStairs.class); - schemes.registerSchematicBlock(Blocks.jungle_stairs, SchematicStairs.class); - schemes.registerSchematicBlock(Blocks.quartz_stairs, SchematicStairs.class); - schemes.registerSchematicBlock(Blocks.acacia_stairs, SchematicStairs.class); - schemes.registerSchematicBlock(Blocks.dark_oak_stairs, SchematicStairs.class); - schemes.registerSchematicBlock(Blocks.wooden_door, SchematicDoor.class, new ItemStack(Items.wooden_door)); schemes.registerSchematicBlock(Blocks.iron_door, SchematicDoor.class, new ItemStack(Items.iron_door)); @@ -466,16 +443,6 @@ public class BuildCraftBuilders extends BuildCraftMod { schemes.registerSchematicBlock(Blocks.mob_spawner, SchematicTileCreative.class); - schemes.registerSchematicBlock(Blocks.glass, SchematicStandalone.class); - schemes.registerSchematicBlock(Blocks.stone_slab, SchematicStandalone.class); - schemes.registerSchematicBlock(Blocks.double_stone_slab, SchematicStandalone.class); - schemes.registerSchematicBlock(Blocks.wooden_slab, SchematicStandalone.class); - schemes.registerSchematicBlock(Blocks.double_wooden_slab, SchematicStandalone.class); - schemes.registerSchematicBlock(Blocks.stained_glass, SchematicStandalone.class); - schemes.registerSchematicBlock(Blocks.fence, SchematicStandalone.class); - schemes.registerSchematicBlock(Blocks.daylight_detector, SchematicStandalone.class); - schemes.registerSchematicBlock(Blocks.iron_bars, SchematicStandalone.class); - // Standard entities schemes.registerSchematicEntity(EntityMinecartEmpty.class, SchematicMinecart.class, Items.minecart); diff --git a/common/buildcraft/builders/HeuristicBlockDetection.java b/common/buildcraft/builders/HeuristicBlockDetection.java index 952272f4..4ca1fcd2 100644 --- a/common/buildcraft/builders/HeuristicBlockDetection.java +++ b/common/buildcraft/builders/HeuristicBlockDetection.java @@ -3,7 +3,12 @@ package buildcraft.builders; import java.util.Iterator; import net.minecraft.block.Block; +import net.minecraft.block.BlockBasePressurePlate; import net.minecraft.block.BlockBush; +import net.minecraft.block.BlockButton; +import net.minecraft.block.BlockLever; +import net.minecraft.block.BlockStairs; +import net.minecraft.block.BlockTorch; import net.minecraft.block.IGrowable; import net.minecraft.init.Blocks; @@ -13,9 +18,11 @@ import net.minecraftforge.fluids.IFluidBlock; import buildcraft.api.blueprints.SchematicBlock; import buildcraft.api.blueprints.SchematicFluid; +import buildcraft.builders.schematics.SchematicStairs; import buildcraft.core.blueprints.SchematicRegistry; import buildcraft.core.builders.schematics.SchematicBlockFloored; import buildcraft.core.builders.schematics.SchematicTileCreative; +import buildcraft.core.builders.schematics.SchematicWallSide; public final class HeuristicBlockDetection { private HeuristicBlockDetection() { @@ -47,8 +54,12 @@ public final class HeuristicBlockDetection { SchematicRegistry.INSTANCE.registerSchematicBlock(block, meta, SchematicFluid.class, new FluidStack(fblock.getFluid(), 1000)); } } else { - if (block instanceof BlockBush || block instanceof IPlantable || block instanceof IGrowable) { + if (block instanceof BlockBush || block instanceof IPlantable || block instanceof IGrowable || block instanceof BlockBasePressurePlate) { SchematicRegistry.INSTANCE.registerSchematicBlock(block, meta, SchematicBlockFloored.class); + } else if (block instanceof BlockLever || block instanceof BlockTorch || block instanceof BlockButton) { + SchematicRegistry.INSTANCE.registerSchematicBlock(block, meta, SchematicWallSide.class); + } else if (block instanceof BlockStairs) { + SchematicRegistry.INSTANCE.registerSchematicBlock(block, meta, SchematicStairs.class); } else { SchematicRegistry.INSTANCE.registerSchematicBlock(block, meta, SchematicBlock.class); } diff --git a/common/buildcraft/builders/LibraryBlueprintTypeHandler.java b/common/buildcraft/builders/LibraryBlueprintTypeHandler.java index 273dd9ed..f8f38cbf 100644 --- a/common/buildcraft/builders/LibraryBlueprintTypeHandler.java +++ b/common/buildcraft/builders/LibraryBlueprintTypeHandler.java @@ -19,9 +19,9 @@ public class LibraryBlueprintTypeHandler extends LibraryTypeHandlerNBT { @Override public boolean isHandler(ItemStack stack, HandlerType type) { if (isBlueprint) { - return stack.getItem() instanceof ItemBlueprintStandard && ItemBlueprint.isContentReadable(stack); + return stack.getItem() instanceof ItemBlueprintStandard && (type == HandlerType.LOAD || ItemBlueprint.isContentReadable(stack)); } else { - return stack.getItem() instanceof ItemBlueprintTemplate && ItemBlueprint.isContentReadable(stack); + return stack.getItem() instanceof ItemBlueprintTemplate && (type == HandlerType.LOAD || ItemBlueprint.isContentReadable(stack)); } } diff --git a/common/buildcraft/builders/schematics/SchematicLever.java b/common/buildcraft/builders/schematics/SchematicLever.java deleted file mode 100644 index fd647d63..00000000 --- a/common/buildcraft/builders/schematics/SchematicLever.java +++ /dev/null @@ -1,23 +0,0 @@ -/** - * Copyright (c) 2011-2015, 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.builders.schematics; - -import buildcraft.api.blueprints.IBuilderContext; -import buildcraft.core.builders.schematics.SchematicWallSide; - -public class SchematicLever extends SchematicWallSide { - @Override - public void rotateLeft(IBuilderContext context) { - int status = meta & 8; - - meta -= status; - super.rotateLeft(context); - meta += status; - } -} diff --git a/common/buildcraft/builders/schematics/SchematicSilverfish.java b/common/buildcraft/builders/schematics/SchematicSilverfish.java new file mode 100755 index 00000000..6a1e7453 --- /dev/null +++ b/common/buildcraft/builders/schematics/SchematicSilverfish.java @@ -0,0 +1,59 @@ +/** + * Copyright (c) 2011-2015, 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.builders.schematics; + +import java.util.LinkedList; + +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; + +import buildcraft.api.blueprints.IBuilderContext; +import buildcraft.api.blueprints.SchematicBlock; + +public class SchematicSilverfish extends SchematicBlock { + private Block getRealBlock() { + if (meta == 0) { + return Blocks.stone; + } else if (meta == 1) { + return Blocks.cobblestone; + } else if (meta <= 5) { + return Blocks.stonebrick; + } else { + return Blocks.stone; + } + } + + private int getRealMetadata() { + if (meta >= 2 && meta <= 5) { + return meta - 2; + } + return 0; + } + + @Override + public void getRequirementsForPlacement(IBuilderContext context, LinkedList