Jump to content

Matt Wild

Members
  • Posts

    5
  • Joined

  • Last visited

Everything posted by Matt Wild

  1. try { RenderTypeLookup.setRenderLayer(RegistryHandler.SOL_LANTERN.get(), RenderType.getCutout()); } catch (java.lang.NoClassDefFoundError e) { } I put this code into my setup method within the main class. To my understanding, you parse in the block and RenderType to set how the client will render it. The catch statement is just a cheap way to stop a server from crashing if it were to use this mod Apologies for posting on this old thread again, but the guys clearly new here with 1 post, might as well try to help him out.
  2. Hey, thanks for the heads up ^^ I was very confused at first because I thought that the content of the class was the dependant factor for the texture rendering correctly. As for the confusion with the parameters, I realised I could grab the block from the registry. (none of this I've done before so I'm glad it's cleared up)
  3. Hi, thanks for the reply and the example! My lantern is a lot less fancy than the example given but I figured that I needed the following: - notSolid() to be called in the block properties - make the getRenderType method return BlockRenderType.MODEL My new class looks like this: import net.minecraft.block.*; import net.minecraft.block.material.Material; import net.minecraftforge.common.ToolType; public class GemLanternBase extends LanternBlock { public GemLanternBase(int lightValue) { super(LanternBlock.Properties.create(Material.IRON) .hardnessAndResistance(3.5f, 3.5f) .sound(SoundType.LANTERN) .harvestLevel(0) .harvestTool(ToolType.PICKAXE) .setRequiresTool() .setLightLevel(value -> lightValue) .notSolid()); } @Override public BlockRenderType getRenderType(BlockState iBlockState) { return BlockRenderType.MODEL; } } However, the issue is persisting. The chain still has black pixels where the transparent pixels should be. I also tried applying the voxel model but that didn't seem to make a difference. I'm very confused as to what causes Minecraft to allow for transparency. Could you elaborate on what is missing from my class? Many thanks EDIT: I've solved the problem! Nothing was wrong with my class lol, though the example has been very helpful for adding new functionality! Turns out I needed to call setRenderLayer from RenderTypeLookup in my client setup method. I had no idea this was a thing and when I first saw it I thought it was for blocks structures specifically. As I said I'm very new to this and I'm glad this is figured out, this is my first mod that I'm playing around with. All I can say is thank god this forums exists, I find the official documentation for this to be kinda lack-lustre.
  4. Hi, I've been trying to make a modded lantern using net.minecraft.block.LanternBlock as a base. My current class is as follows: import net.minecraft.block.*; import net.minecraft.block.material.Material; import net.minecraftforge.common.ToolType; public class GemLanternBase extends LanternBlock { public GemLanternBase(int lightValue) { super(LanternBlock.Properties.create(Material.IRON) .hardnessAndResistance(3.5f, 3.5f) .sound(SoundType.LANTERN) .harvestLevel(0) .harvestTool(ToolType.PICKAXE) .setLightLevel(value -> lightValue)); } } I figured that using the default lantern would mean that the model in-game would support transparency, but I seem to be wrong. The modded lantern has one difference to the default one, the chain texture doesn't support transparency. It's really annoying and I have no idea what I need to do in order to fix this. Is anyone able to help me on this one? (p.s. I'm quite new to modding so treat me like I'm an idiot, thanks :D)
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.