Merge pull request #77 from Maeyanie/master

Config option: Fillers destroy blocks
This commit is contained in:
SirSengir 2012-07-05 03:58:24 -07:00
commit 5458dde84f
3 changed files with 13 additions and 1 deletions

View file

@ -80,6 +80,7 @@ public class BuildCraftBuilders {
public static BlockBlueprintLibrary libraryBlock; public static BlockBlueprintLibrary libraryBlock;
public static ItemBptTemplate templateItem; public static ItemBptTemplate templateItem;
public static ItemBptBluePrint blueprintItem; public static ItemBptBluePrint blueprintItem;
public static boolean fillerDestroy;
private static boolean initialized = false; private static boolean initialized = false;
@ -124,6 +125,11 @@ public class BuildCraftBuilders {
Property libraryId = BuildCraftCore.mainConfiguration.getOrCreateBlockIdProperty("blueprintLibrary.id", Property libraryId = BuildCraftCore.mainConfiguration.getOrCreateBlockIdProperty("blueprintLibrary.id",
DefaultProps.BLUEPRINT_LIBRARY_ID); DefaultProps.BLUEPRINT_LIBRARY_ID);
Property fillerDestroyProp = BuildCraftCore.mainConfiguration.getOrCreateBooleanProperty("filler.destroy",
Configuration.CATEGORY_GENERAL, DefaultProps.FILLER_DESTROY);
fillerDestroyProp.comment = "If true, Filler will destroy blocks instead of breaking them.";
fillerDestroy = Boolean.parseBoolean(fillerDestroyProp.value);
BuildCraftCore.mainConfiguration.save(); BuildCraftCore.mainConfiguration.save();
templateItem = new ItemBptTemplate(Integer.parseInt(templateItemId.value)); templateItem = new ItemBptTemplate(Integer.parseInt(templateItemId.value));

View file

@ -10,6 +10,7 @@
package net.minecraft.src.buildcraft.builders; package net.minecraft.src.buildcraft.builders;
import net.minecraft.src.BuildCraftBlockUtil; import net.minecraft.src.BuildCraftBlockUtil;
import net.minecraft.src.BuildCraftBuilders;
import net.minecraft.src.ItemStack; import net.minecraft.src.ItemStack;
import net.minecraft.src.TileEntity; import net.minecraft.src.TileEntity;
import net.minecraft.src.World; import net.minecraft.src.World;
@ -95,8 +96,12 @@ public abstract class FillerPattern implements IFillerPattern {
} }
if (lastX != Integer.MAX_VALUE) { if (lastX != Integer.MAX_VALUE) {
if (BuildCraftBuilders.fillerDestroy) {
world.setBlockWithNotify(lastX, lastY, lastZ, 0);
} else {
BuildCraftBlockUtil.breakBlock(world, lastX, lastY, lastZ); BuildCraftBlockUtil.breakBlock(world, lastX, lastY, lastZ);
} }
}
return lastX == Integer.MAX_VALUE; return lastX == Integer.MAX_VALUE;
} }

View file

@ -111,6 +111,7 @@ public class DefaultProps {
public static boolean CURRENT_CONTINUOUS = false; public static boolean CURRENT_CONTINUOUS = false;
public static boolean PIPES_ALWAYS_CONNECT = false; public static boolean PIPES_ALWAYS_CONNECT = false;
public static boolean FILLER_DESTROY = false;
public static int TRIGGER_REDSTONE_ACTIVE = 1; public static int TRIGGER_REDSTONE_ACTIVE = 1;
public static int TRIGGER_REDSTONE_INACTIVE = 2; public static int TRIGGER_REDSTONE_INACTIVE = 2;