From 6f01a384fe1c846dcccf4c1e2bc3ea969622c5ad Mon Sep 17 00:00:00 2001 From: TheMCBrothers Date: Tue, 31 Dec 2019 16:08:18 +0100 Subject: [PATCH] Fixed some render types --- CHANGELOG.md | 2 + gradle.properties | 6 +-- .../themcbros/uselessmod/lists/ModBlocks.java | 40 +++++++++++++++++++ .../themcbros/uselessmod/lists/ModFluids.java | 11 +++++ 4 files changed, 56 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f08b5677..f2838bfd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,8 @@ ### 1.15.1-3.0.1 - Fluids in guis render again +- Fixed some render type issues (still some present) +- Fixed Large Useless Fern Loot Table ### 1.15.1-3.0.0 - Initial 1.15.1 release diff --git a/gradle.properties b/gradle.properties index 1157fb68..fb90f53a 100644 --- a/gradle.properties +++ b/gradle.properties @@ -4,10 +4,10 @@ org.gradle.jvmargs=-Xmx3G org.gradle.daemon=false modname=Useless Mod -version=1.15.1-3.0.0 +version=1.15.1-3.0.1 mc_version=1.15.1 -forge_version=30.0.18 -mcp_mappings=20191229-1.14.3 +forge_version=30.0.19 +mcp_mappings=20191231-1.14.3 jei_version=1.14.4:6.0.0.26 hwyla_version=1.10.6-B67_1.14.4 filters_version=1.1.1:1.14.4 diff --git a/src/main/java/tk/themcbros/uselessmod/lists/ModBlocks.java b/src/main/java/tk/themcbros/uselessmod/lists/ModBlocks.java index e519636c..17ad3405 100644 --- a/src/main/java/tk/themcbros/uselessmod/lists/ModBlocks.java +++ b/src/main/java/tk/themcbros/uselessmod/lists/ModBlocks.java @@ -6,12 +6,16 @@ import net.minecraft.block.*; import net.minecraft.block.material.Material; import net.minecraft.block.material.MaterialColor; +import net.minecraft.client.renderer.RenderType; +import net.minecraft.client.renderer.RenderTypeLookup; import net.minecraft.potion.Effects; import net.minecraft.util.ResourceLocation; +import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.event.RegistryEvent; import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.common.Mod.EventBusSubscriber.Bus; +import net.minecraftforge.fml.loading.FMLEnvironment; import net.minecraftforge.registries.ObjectHolder; import tk.themcbros.uselessmod.UselessMod; import tk.themcbros.uselessmod.blocks.*; @@ -111,6 +115,42 @@ public static void blockRegister(final RegistryEvent.Register event) { event.getRegistry().register(block); }); UselessMod.LOGGER.debug("Registered useless blocks"); + + if (FMLEnvironment.dist == Dist.CLIENT) { + RenderType transparentRenderType = RenderType.func_228641_d_(); + RenderType cutoutRenderType = RenderType.func_228643_e_(); + RenderType translucentRenderType = RenderType.func_228645_f_(); + + RenderTypeLookup.setRenderLayer(USELESS_GRASS_BLOCK, transparentRenderType); + RenderTypeLookup.setRenderLayer(USELESS_LEAVES, transparentRenderType); + RenderTypeLookup.setRenderLayer(USELESS_BARS, transparentRenderType); + RenderTypeLookup.setRenderLayer(SUPER_USELESS_BARS, transparentRenderType); + + RenderTypeLookup.setRenderLayer(USELESS_SAPLING, cutoutRenderType); + RenderTypeLookup.setRenderLayer(USELESS_GRASS, cutoutRenderType); + RenderTypeLookup.setRenderLayer(USELESS_FERN, cutoutRenderType); + RenderTypeLookup.setRenderLayer(LARGE_USELESS_FERN, cutoutRenderType); + RenderTypeLookup.setRenderLayer(TALL_USELESS_GRASS, cutoutRenderType); + RenderTypeLookup.setRenderLayer(RED_ROSE, cutoutRenderType); + RenderTypeLookup.setRenderLayer(BLUE_ROSE, cutoutRenderType); + RenderTypeLookup.setRenderLayer(USELESS_WHEAT, cutoutRenderType); + RenderTypeLookup.setRenderLayer(WILD_USELESS_WHEAT, cutoutRenderType); + RenderTypeLookup.setRenderLayer(COFFEE_SEEDS, cutoutRenderType); + RenderTypeLookup.setRenderLayer(WILD_COFFEE_SEEDS, cutoutRenderType); + + RenderTypeLookup.setRenderLayer(POTTED_USELESS_SAPLING, cutoutRenderType); + RenderTypeLookup.setRenderLayer(POTTED_USELESS_FERN, cutoutRenderType); + RenderTypeLookup.setRenderLayer(POTTED_RED_ROSE, cutoutRenderType); + RenderTypeLookup.setRenderLayer(POTTED_BLUE_ROSE, cutoutRenderType); + + RenderTypeLookup.setRenderLayer(USELESS_DOOR, cutoutRenderType); + RenderTypeLookup.setRenderLayer(SUPER_USELESS_DOOR, cutoutRenderType); + RenderTypeLookup.setRenderLayer(WOODEN_USELESS_DOOR, cutoutRenderType); + RenderTypeLookup.setRenderLayer(USELESS_TRAPDOOR, cutoutRenderType); + RenderTypeLookup.setRenderLayer(FLUID_TANK, cutoutRenderType); + RenderTypeLookup.setRenderLayer(CLOSET, cutoutRenderType); + } + } public static T register(String name, T block) { diff --git a/src/main/java/tk/themcbros/uselessmod/lists/ModFluids.java b/src/main/java/tk/themcbros/uselessmod/lists/ModFluids.java index 48882462..57afb73b 100644 --- a/src/main/java/tk/themcbros/uselessmod/lists/ModFluids.java +++ b/src/main/java/tk/themcbros/uselessmod/lists/ModFluids.java @@ -1,14 +1,18 @@ package tk.themcbros.uselessmod.lists; import com.google.common.collect.Lists; +import net.minecraft.client.renderer.RenderType; +import net.minecraft.client.renderer.RenderTypeLookup; import net.minecraft.fluid.FlowingFluid; import net.minecraft.fluid.Fluid; import net.minecraft.util.ResourceLocation; +import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.event.RegistryEvent; import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.fluids.FluidAttributes; import net.minecraftforge.fluids.ForgeFlowingFluid; import net.minecraftforge.fml.common.Mod; +import net.minecraftforge.fml.loading.FMLEnvironment; import net.minecraftforge.registries.ObjectHolder; import tk.themcbros.uselessmod.UselessMod; @@ -38,6 +42,13 @@ private static T registerFluid(String registryName, T fluid) { public static void onFluidRegister(final RegistryEvent.Register event) { FLUIDS.forEach(event.getRegistry()::register); UselessMod.LOGGER.debug("Registered fluids"); + + if (FMLEnvironment.dist == Dist.CLIENT) { + RenderType translucentRenderType = RenderType.func_228645_f_(); + + RenderTypeLookup.setRenderLayer(USELESS_WATER, translucentRenderType); + RenderTypeLookup.setRenderLayer(FLOWING_USELESS_WATER, translucentRenderType); + } } }