Add config option to support Fillers destroying blocks instead of breaking them.

Prevents Fillers from being (ab)used as cheap Quarries.
This commit is contained in:
Maeyanie 2012-07-04 21:47:52 -04:00
parent a24e3c25ef
commit 7f642772ed
3 changed files with 13 additions and 1 deletions

View file

@ -80,6 +80,7 @@ public class BuildCraftBuilders {
public static BlockBlueprintLibrary libraryBlock;
public static ItemBptTemplate templateItem;
public static ItemBptBluePrint blueprintItem;
public static boolean fillerDestroy;
private static boolean initialized = false;
@ -124,6 +125,11 @@ public class BuildCraftBuilders {
Property libraryId = BuildCraftCore.mainConfiguration.getOrCreateBlockIdProperty("blueprintLibrary.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();
templateItem = new ItemBptTemplate(Integer.parseInt(templateItemId.value));

View file

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

View file

@ -111,6 +111,7 @@ public class DefaultProps {
public static boolean CURRENT_CONTINUOUS = 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_INACTIVE = 2;