diff --git a/src/main/java/mods/betterfoliage/client/render/impl/RenderBlockCactus.java b/src/main/java/mods/betterfoliage/client/render/impl/RenderBlockCactus.java index 9d38b050..8e648aad 100644 --- a/src/main/java/mods/betterfoliage/client/render/impl/RenderBlockCactus.java +++ b/src/main/java/mods/betterfoliage/client/render/impl/RenderBlockCactus.java @@ -10,7 +10,6 @@ import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.client.renderer.Tessellator; -import net.minecraft.init.Blocks; import net.minecraft.util.IIcon; import net.minecraft.world.IBlockAccess; import net.minecraftforge.client.event.TextureStitchEvent; @@ -36,7 +35,7 @@ public RenderBlockCactus() { } public boolean isBlockAccepted(IBlockAccess blockAccess, int x, int y, int z, Block block, int original) { - return Config.cactusEnabled && block == Blocks.cactus && getCameraDistance(x, y, z) <= Config.cactusDistance; + return Config.cactusEnabled && Config.cactus.matchesID(block) && getCameraDistance(x, y, z) <= Config.cactusDistance; } public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) { diff --git a/src/main/java/mods/betterfoliage/client/render/impl/RenderBlockLilypad.java b/src/main/java/mods/betterfoliage/client/render/impl/RenderBlockLilypad.java index c532a504..0b115d96 100644 --- a/src/main/java/mods/betterfoliage/client/render/impl/RenderBlockLilypad.java +++ b/src/main/java/mods/betterfoliage/client/render/impl/RenderBlockLilypad.java @@ -9,7 +9,6 @@ import net.minecraft.block.Block; import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.client.renderer.Tessellator; -import net.minecraft.init.Blocks; import net.minecraft.world.IBlockAccess; import net.minecraftforge.client.event.TextureStitchEvent; import net.minecraftforge.common.util.ForgeDirection; @@ -28,7 +27,7 @@ public RenderBlockLilypad() { } public boolean isBlockAccepted(IBlockAccess blockAccess, int x, int y, int z, Block block, int original) { - return Config.lilypadEnabled && block == Blocks.waterlily && getCameraDistance(x, y, z) <= Config.lilypadDistance; + return Config.lilypadEnabled && Config.lilypad.matchesID(block) && getCameraDistance(x, y, z) <= Config.lilypadDistance; } public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) { diff --git a/src/main/java/mods/betterfoliage/client/render/impl/RenderBlockSandWithCoral.java b/src/main/java/mods/betterfoliage/client/render/impl/RenderBlockSandWithCoral.java index 6ecb1003..a3f55f22 100644 --- a/src/main/java/mods/betterfoliage/client/render/impl/RenderBlockSandWithCoral.java +++ b/src/main/java/mods/betterfoliage/client/render/impl/RenderBlockSandWithCoral.java @@ -13,7 +13,6 @@ import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.client.renderer.Tessellator; -import net.minecraft.init.Blocks; import net.minecraft.util.IIcon; import net.minecraft.util.MathHelper; import net.minecraft.world.IBlockAccess; @@ -31,7 +30,7 @@ public class RenderBlockSandWithCoral extends RenderBlockAOBase implements IRend public boolean isBlockAccepted(IBlockAccess blockAccess, int x, int y, int z, Block block, int original) { if (!Config.coralEnabled) return false; - if (block != Blocks.sand) return false; + if (!Config.sand.matchesID(block)) return false; if (getCameraDistance(x, y, z) > Config.coralDistance) return false; if (!Config.coralBiomeList.contains(blockAccess.getBiomeGenForCoords(x, z).biomeID)) return false; int terrainVariation = MathHelper.floor_double((noise.func_151605_a(x * 0.1, z * 0.1) + 1.0) * 32.0); diff --git a/src/main/java/mods/betterfoliage/common/config/Config.java b/src/main/java/mods/betterfoliage/common/config/Config.java index 8a742203..ff51b82f 100644 --- a/src/main/java/mods/betterfoliage/common/config/Config.java +++ b/src/main/java/mods/betterfoliage/common/config/Config.java @@ -38,6 +38,9 @@ public enum Category { public static BlockMatcher dirt = new BlockMatcher(); public static BlockMatcher grass = new BlockMatcher(); public static BlockMatcher logs = new BlockMatcher(); + public static BlockMatcher sand = new BlockMatcher(); + public static BlockMatcher lilypad = new BlockMatcher(); + public static BlockMatcher cactus = new BlockMatcher(); // extracted config values public static boolean globalEnabled; @@ -269,6 +272,9 @@ public static void updateValues() { updateBlockMatcher(leaves, Category.blockTypes, "leavesWhitelist", "betterfoliage.blockTypes.leavesWhitelist", "leavesBlacklist", "betterfoliage.blockTypes.leavesBlacklist", new ResourceLocation("betterfoliage:classesLeavesDefault.cfg")); updateBlockMatcher(crops, Category.blockTypes, "cropWhitelist", "betterfoliage.blockTypes.cropWhitelist", "cropBlacklist", "betterfoliage.blockTypes.cropBlacklist", new ResourceLocation("betterfoliage:classesCropDefault.cfg")); updateBlockMatcher(logs, Category.blockTypes, "logWhitelist", "betterfoliage.blockTypes.logWhitelist", "logBlacklist", "betterfoliage.blockTypes.logBlacklist", new ResourceLocation("betterfoliage:classesLogDefault.cfg")); + updateBlockMatcher(sand, Category.blockTypes, "sandWhitelist", "betterfoliage.blockTypes.sandWhitelist", "sandBlacklist", "betterfoliage.blockTypes.sandBlacklist", new ResourceLocation("betterfoliage:classesSandDefault.cfg")); + updateBlockMatcher(lilypad, Category.blockTypes, "lilypadWhitelist", "betterfoliage.blockTypes.lilypadWhitelist", "lilypadBlacklist", "betterfoliage.blockTypes.lilypadBlacklist", new ResourceLocation("betterfoliage:classesLilypadDefault.cfg")); + updateBlockMatcher(cactus, Category.blockTypes, "cactusWhitelist", "betterfoliage.blockTypes.cactusWhitelist", "cactusBlacklist", "betterfoliage.blockTypes.cactusBlacklist", new ResourceLocation("betterfoliage:classesCactusDefault.cfg")); rawConfig.getCategory(Category.extraLeaves.toString()).get("skewMode").setConfigEntryClass(AlternateTextBooleanEntry.class); rawConfig.getCategory(Category.extraLeaves.toString()).get("dense").setConfigEntryClass(AlternateTextBooleanEntry.class); diff --git a/src/main/resources/assets/betterfoliage/classesCactusDefault.cfg b/src/main/resources/assets/betterfoliage/classesCactusDefault.cfg new file mode 100644 index 00000000..b5720e8b --- /dev/null +++ b/src/main/resources/assets/betterfoliage/classesCactusDefault.cfg @@ -0,0 +1,5 @@ +// Vanilla +net.minecraft.block.BlockCactus + +// TerraFirmaCraft +com.bioxx.tfc.Blocks.Vanilla.BlockCustomCactus \ No newline at end of file diff --git a/src/main/resources/assets/betterfoliage/classesLilypadDefault.cfg b/src/main/resources/assets/betterfoliage/classesLilypadDefault.cfg new file mode 100644 index 00000000..4af6afdc --- /dev/null +++ b/src/main/resources/assets/betterfoliage/classesLilypadDefault.cfg @@ -0,0 +1,5 @@ +// Vanilla +net.minecraft.block.BlockLilyPad + +// TerraFirmaCraft +com.bioxx.tfc.Blocks.Vanilla.BlockCustomLilyPad \ No newline at end of file diff --git a/src/main/resources/assets/betterfoliage/classesSandDefault.cfg b/src/main/resources/assets/betterfoliage/classesSandDefault.cfg new file mode 100644 index 00000000..a1330e88 --- /dev/null +++ b/src/main/resources/assets/betterfoliage/classesSandDefault.cfg @@ -0,0 +1,5 @@ +// Vanilla +net.minecraft.block.BlockSand + +// TerraFirmaCraft +com.bioxx.tfc.Blocks.Terrain.BlockSand \ No newline at end of file diff --git a/src/main/resources/assets/betterfoliage/lang/en_US.lang b/src/main/resources/assets/betterfoliage/lang/en_US.lang index c2fe786b..5ae98243 100644 --- a/src/main/resources/assets/betterfoliage/lang/en_US.lang +++ b/src/main/resources/assets/betterfoliage/lang/en_US.lang @@ -35,6 +35,13 @@ betterfoliage.blockTypes.cropWhitelist=Crop Whitelist betterfoliage.blockTypes.cropBlacklist=Crop Blacklist betterfoliage.blockTypes.logWhitelist=Wood Log Whitelist betterfoliage.blockTypes.logBlacklist=Wood Log Blacklist +betterfoliage.blockTypes.sandWhitelist=Sand Whitelist +betterfoliage.blockTypes.sandBlacklist=Sand Blacklist +betterfoliage.blockTypes.lilypadWhitelist=Lilypad Whitelist +betterfoliage.blockTypes.lilypadBlacklist=Lilypad Blacklist +betterfoliage.blockTypes.cactusWhitelist=Cactus Whitelist +betterfoliage.blockTypes.cactusBlacklist=Cactus Blacklist + betterfoliage.blockTypes.dirtWhitelist.tooltip=Blocks recognized as Dirt. Has an impact on Reeds, Algae, Connected Grass betterfoliage.blockTypes.dirtBlacklist.tooltip=Blocks never accepted as Dirt. Has an impact on Reeds, Algae, Connected Grass @@ -46,6 +53,12 @@ betterfoliage.blockTypes.cropWhitelist.tooltip=Blocks recognized as crops. Crops betterfoliage.blockTypes.cropBlacklist.tooltip=Blocks never accepted as crops. Crops will render with tallgrass block ID in shader programs betterfoliage.blockTypes.logWhitelist.tooltip=Blocks recognized as wooden logs. Has an impact on Rounded Logs betterfoliage.blockTypes.logBlacklist.tooltip=Blocks never accepted as wooden logs. Has an impact on Rounded Logs +betterfoliage.blockTypes.sandWhitelist.tooltip=Blocks recognized as Sand. Has an impact on Coral +betterfoliage.blockTypes.sandBlacklist.tooltip=Blocks never accepted Sand. Has an impact on Coral +betterfoliage.blockTypes.lilypadWhitelist.tooltip=Blocks recognized as Lilypad. Has an impact on Better Lilypad +betterfoliage.blockTypes.lilypadBlacklist.tooltip=Blocks never accepted Lilypad. Has an impact on Better Lilypad +betterfoliage.blockTypes.cactusWhitelist.tooltip=Blocks recognized as Cactus. Has an impact on Better Cactus +betterfoliage.blockTypes.cactusBlacklist.tooltip=Blocks never accepted Cactus. Has an impact on Better Cactus betterfoliage.extraLeaves=Extra Leaves betterfoliage.extraLeaves.tooltip=Extra round leaves on leaf blocks