Skip to content

Commit

Permalink
Fixed some render types
Browse files Browse the repository at this point in the history
  • Loading branch information
TheMCBrothers-Manager committed Dec 31, 2019
1 parent e447275 commit 6f01a38
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 3 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
6 changes: 3 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
40 changes: 40 additions & 0 deletions src/main/java/tk/themcbros/uselessmod/lists/ModBlocks.java
Original file line number Diff line number Diff line change
Expand Up @@ -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.*;
Expand Down Expand Up @@ -111,6 +115,42 @@ public static void blockRegister(final RegistryEvent.Register<Block> 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 extends Block> T register(String name, T block) {
Expand Down
11 changes: 11 additions & 0 deletions src/main/java/tk/themcbros/uselessmod/lists/ModFluids.java
Original file line number Diff line number Diff line change
@@ -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;

Expand Down Expand Up @@ -38,6 +42,13 @@ private static <T extends Fluid> T registerFluid(String registryName, T fluid) {
public static void onFluidRegister(final RegistryEvent.Register<Fluid> 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);
}
}

}

0 comments on commit 6f01a38

Please sign in to comment.