Add config to render floating flowers in static renderer

This commit is contained in:
Vincent Lee committed 2016-08-19 20:19:00 -05:00
1 parent 2fe7d5e025
commit 1b97974d0e
4 files changed
+17 -1

No files matched your search

@@ -20,6 +20,7 @@ import net.minecraft.client.renderer.texture.TextureMap;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.tileentity.TileEntity;
import vazkii.botania.client.core.handler.ClientTickHandler;
import vazkii.botania.common.core.handler.ConfigHandler;
import javax.annotation.Nonnull;
import java.util.Random;
@@ -28,6 +29,9 @@ public class RenderTileFloatingFlower extends TileEntitySpecialRenderer {
@Override
public void renderTileEntityAt(@Nonnull TileEntity tile, double d0, double d1, double d2, float t, int digProgress) {
if(ConfigHandler.staticFloaters)
return;
if (tile != null)
if (!tile.getWorld().isBlockLoaded(tile.getPos(), false))
return;
@@ -23,6 +23,7 @@ import net.minecraft.item.EnumDyeColor;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.BlockRenderLayer;
import net.minecraft.util.EnumBlockRenderType;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand;
@@ -87,7 +88,13 @@ public class BlockFloatingFlower extends BlockMod implements ILexiconable, IInfu
@Nonnull
@Override
public EnumBlockRenderType getRenderType(IBlockState state) {
return EnumBlockRenderType.ENTITYBLOCK_ANIMATED;
return ConfigHandler.staticFloaters ? EnumBlockRenderType.MODEL : EnumBlockRenderType.ENTITYBLOCK_ANIMATED;
}
@Nonnull
@Override
public BlockRenderLayer getBlockLayer() {
return BlockRenderLayer.CUTOUT;
}
@Nonnull
@@ -67,6 +67,7 @@ public final class ConfigHandler {
public static int glSecondaryTextureUnit = 7;
public static boolean altFlowerTextures = false;
public static boolean staticFloaters = false;
public static boolean matrixMode = false;
public static boolean referencesEnabled = true;
@@ -185,6 +186,9 @@ public final class ConfigHandler {
desc = "The GL Texture Unit to use for the secondary sampler passed in to the Lexica Botania's category button shader. DO NOT TOUCH THIS IF YOU DON'T KNOW WHAT YOU'RE DOING";
glSecondaryTextureUnit = loadPropInt("shaders.secondaryUnit", desc, glSecondaryTextureUnit);
desc = "Set this to true if you use lots of floating flowers and are experiencing rendering lag. Will disable the floating flowers' animations and render them statically for a major performance boost.";
staticFloaters = loadPropBool("staticFloaters.enabled", desc, staticFloaters);
desc = "Set this to true if you are the chosen one. For lovers of glitch art and just general mad people.";
matrixMode = loadPropBool("matrixMode.enabled", desc, matrixMode);