Add config to prevent chiseling between vanilla leaf types.

Closes #171
This commit is contained in:
tterrag1098 committed 2015-01-24 23:32:51 -05:00
1 parent b031b25ab4
commit a4f779ef0f
2 files changed
+23 -1

No files matched your search

@@ -1,5 +1,7 @@
package com.cricketcraft.chisel;
import java.util.List;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.init.Blocks;
@@ -12,6 +14,7 @@ import net.minecraftforge.oredict.OreDictionary;
import net.minecraftforge.oredict.ShapedOreRecipe;
import net.minecraftforge.oredict.ShapelessOreRecipe;
import com.cricketcraft.chisel.api.carving.ICarvingVariation;
import com.cricketcraft.chisel.block.BlockAutoChisel;
import com.cricketcraft.chisel.block.BlockBeaconBase;
import com.cricketcraft.chisel.block.BlockCarvable;
@@ -53,6 +56,7 @@ import com.cricketcraft.chisel.block.IStairsCreator;
import com.cricketcraft.chisel.carving.CarvableHelper;
import com.cricketcraft.chisel.carving.CarvableVariation;
import com.cricketcraft.chisel.carving.Carving;
import com.cricketcraft.chisel.carving.CarvingGroup;
import com.cricketcraft.chisel.config.Configurations;
import com.cricketcraft.chisel.entity.EntityBallOMoss;
import com.cricketcraft.chisel.entity.EntityCloudInABottle;
@@ -68,11 +72,11 @@ import com.cricketcraft.chisel.item.ItemSmashingRock;
import com.cricketcraft.chisel.item.ItemUpgrade;
import com.cricketcraft.chisel.item.chisel.ItemChisel;
import com.cricketcraft.chisel.item.chisel.ItemChisel.ChiselType;
import com.google.common.collect.Lists;
import cpw.mods.fml.common.Loader;
import cpw.mods.fml.common.registry.EntityRegistry;
import cpw.mods.fml.common.registry.GameRegistry;
import static com.cricketcraft.chisel.init.ChiselBlocks.*;
import static com.cricketcraft.chisel.utils.General.*;
@@ -1206,6 +1210,22 @@ public enum Features {
@Override
void addBlocks() {
BlockLeaf leaves = (BlockLeaf) new BlockLeaf(Material.leaves).setCreativeTab(ChiselTabs.tabOtherChiselBlocks).setHardness(0.2F).setStepSound(Block.soundTypeGrass);
Carving.chisel.addGroup(new CarvingGroup("leaves") {
public List<ICarvingVariation> getVariations() {
if (Configurations.chiselBackToVanillaLeaves) {
return super.getVariations();
} else {
List<ICarvingVariation> ret = Lists.newArrayList();
for (ICarvingVariation v : super.getVariations()) {
if (v.getBlock() != Blocks.leaves && v.getBlock() != Blocks.leaves2) {
ret.add(v);
}
}
return ret;
}
}
});
Carving.chisel.addVariation("leaves", Blocks.leaves, 0, 0);
Carving.chisel.addVariation("leaves", Blocks.leaves, 1, 0);
Carving.chisel.addVariation("leaves", Blocks.leaves, 2, 0);
@@ -22,6 +22,7 @@ public class Configurations {
public static boolean chiselRecipe;
public static boolean enableFMP;
public static boolean chiselStoneToCobbleBricks;
public static boolean chiselBackToVanillaLeaves;
public static int marbleAmount;
public static int limestoneAmount;
@@ -62,6 +63,7 @@ public class Configurations {
chiselRecipe = config.get(category, "chiselAlternateRecipe", false, "Use alternative crafting recipe for the chisel").getBoolean(false);
enableFMP = config.get(category, "enableFMP", true, "Do you want to enable FMP").getBoolean(true);
chiselStoneToCobbleBricks = config.get(category, "chiselStoneToCobbleBricks", true, "Chisel stone to cobblestone and bricks by left clicking.").getBoolean(false);
chiselBackToVanillaLeaves = config.get(category, "chiselBackToVanillaLeaves", false, "If this is true, you can chisel from the chisel leaves back to vanilla ones. If it is false, you cannot.").getBoolean(false);
/* worldgen */
category = "worldgen";