From c686cf7e8d045c8798b965a56b4304a4ceca2f73 Mon Sep 17 00:00:00 2001 From: Hea3veN Date: Fri, 29 May 2015 01:08:56 -0300 Subject: [PATCH] Restore config option to make filler/builder drop blocks, fixes #2692 --- buildcraft_resources/assets/buildcraft/lang/en_US.lang | 3 +++ buildcraft_resources/changelog/7.0.6 | 4 ++++ common/buildcraft/BuildCraftBuilders.java | 4 ++++ common/buildcraft/core/builders/BuildingSlotBlock.java | 10 +++++++++- 4 files changed, 20 insertions(+), 1 deletion(-) diff --git a/buildcraft_resources/assets/buildcraft/lang/en_US.lang b/buildcraft_resources/assets/buildcraft/lang/en_US.lang index bfeba379..b82180f8 100644 --- a/buildcraft_resources/assets/buildcraft/lang/en_US.lang +++ b/buildcraft_resources/assets/buildcraft/lang/en_US.lang @@ -78,6 +78,7 @@ color.yellow=Yellow config.general=General config.general.pipes=Pipes config.blueprints=Blueprints +config.builders=Builders config.power=Power Usage config.experimental=Experimental config.display=Display @@ -89,6 +90,8 @@ config.blueprints.clientDatabaseDirectory=Client directory config.blueprints.excludedMods=Excluded mods config.blueprints.excludedBlocks=Excluded blocks +config.builders.dropBrokenBlocks=Drop broken blocks + config.display.colorBlindMode=Colorblind mode config.display.hideFluidValues=Hide fluid numbers config.display.hidePowerValues=Hide power numbers diff --git a/buildcraft_resources/changelog/7.0.6 b/buildcraft_resources/changelog/7.0.6 index 4316d1e1..671516d7 100644 --- a/buildcraft_resources/changelog/7.0.6 +++ b/buildcraft_resources/changelog/7.0.6 @@ -1,3 +1,7 @@ +Additions: + +* [#2692] Restore config option to make filler/builder drop blocks (hea3ven) + Bugs fixed: * [#2730] Fix integration table using energy when it has an invalid recipe (hea3ven) diff --git a/common/buildcraft/BuildCraftBuilders.java b/common/buildcraft/BuildCraftBuilders.java index 7f029f4f..ba807abf 100644 --- a/common/buildcraft/BuildCraftBuilders.java +++ b/common/buildcraft/BuildCraftBuilders.java @@ -239,6 +239,8 @@ public class BuildCraftBuilders extends BuildCraftMod { BuildCraftCore.mainConfigManager.register("general.quarry.oneTimeUse", false, "Should the quarry only be usable once after placing?", ConfigManager.RestartRequirement.NONE); BuildCraftCore.mainConfigManager.register("general.quarry.doChunkLoading", true, "Should the quarry keep the chunks it is working on loaded?", ConfigManager.RestartRequirement.NONE); + BuildCraftCore.mainConfigManager.register("builders.dropBrokenBlocks", false, "Should the builder and filler drop the cleared blocks?", ConfigManager.RestartRequirement.NONE); + BuildCraftCore.mainConfigManager.get("blueprints.serverDatabaseDirectory").setShowInGui(false); BuildCraftCore.mainConfigManager.get("general.markerRange").setMinValue(8).setMaxValue(64); @@ -278,6 +280,8 @@ public class BuildCraftBuilders extends BuildCraftMod { DefaultProps.MARKER_RANGE = BuildCraftCore.mainConfigManager.get("general.markerRange").getInt(); + dropBrokenBlocks = BuildCraftCore.mainConfigManager.get("builders.dropBrokenBlocks").getBoolean(); + if (BuildCraftCore.mainConfiguration.hasChanged()) { BuildCraftCore.mainConfiguration.save(); } diff --git a/common/buildcraft/core/builders/BuildingSlotBlock.java b/common/buildcraft/core/builders/BuildingSlotBlock.java index c3e5a70b..ab43f69f 100755 --- a/common/buildcraft/core/builders/BuildingSlotBlock.java +++ b/common/buildcraft/core/builders/BuildingSlotBlock.java @@ -16,8 +16,11 @@ import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.WorldServer; + import net.minecraftforge.common.util.Constants; +import buildcraft.BuildCraftBuilders; import buildcraft.api.blueprints.BuildingPermission; import buildcraft.api.blueprints.IBuilderContext; import buildcraft.api.blueprints.MappingNotFoundException; @@ -29,6 +32,7 @@ import buildcraft.api.blueprints.SchematicMask; import buildcraft.api.core.BCLog; import buildcraft.api.core.Position; import buildcraft.core.lib.inventory.StackHelper; +import buildcraft.core.lib.utils.BlockUtils; public class BuildingSlotBlock extends BuildingSlot { @@ -56,7 +60,11 @@ public class BuildingSlotBlock extends BuildingSlot { public void writeToWorld(IBuilderContext context) { if (mode == Mode.ClearIfInvalid) { if (!getSchematic().isAlreadyBuilt(context, x, y, z)) { - context.world().setBlockToAir(x, y, z); + if (BuildCraftBuilders.dropBrokenBlocks) { + BlockUtils.breakBlock((WorldServer) context.world(), x, y, z); + } else { + context.world().setBlockToAir(x, y, z); + } } } else { try {