Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

threader

Members
  • Joined

  • Last visited

  1. Hi! I'm creating a block that needs to be translucent, bc the model isn't a perfect cube. When I put it in the ground, the bottom become trasparent. I know it's a well knowed issue, but everything I could find told me to set its render layer with RenderTypeLookup#setRenderLayer (I also found topics which solved this problem overriding the Block#getRenderLayer(), but it doesnt exist anymore in this version) , so, I did it, but nothing changed and the bottom of the block still invisible, I tried getCutout(), getTranslucent() and a bunch of other methods but nothing worked (Yeah, the SetupClient#onClientSetupEvent is being called). Any ideas? (I'm sorry if there is any english grammar mistake or something like that) Here are the code and the block printscreen: package net.threader.generatorsmod; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.eventbus.api.IEventBus; import net.minecraftforge.fml.DistExecutor; import net.minecraftforge.fml.ModLoadingContext; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; import net.threader.generatorsmod.init.SetupClient; import net.threader.generatorsmod.init.SetupCommon; @Mod(GeneratorMod.MODID) public class GeneratorMod { public static final String MODID = "generators"; public static IEventBus MOD_EVENT_BUS; public GeneratorMod() { MOD_EVENT_BUS = FMLJavaModLoadingContext.get().getModEventBus(); MOD_EVENT_BUS.register(SetupCommon.class); DistExecutor.runWhenOn(Dist.CLIENT, () -> GeneratorMod::registerClientOnlyEvents); } public static void registerClientOnlyEvents() { MOD_EVENT_BUS.register(SetupClient.class); } } package net.threader.generatorsmod; import net.minecraft.block.Block; import net.minecraft.block.BlockState; import net.minecraft.block.material.Material; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.IBlockReader; import net.threader.generatorsmod.init.SetupCommon; public class GeneratorBlock extends Block { public GeneratorBlock() { super(Block.Properties.create(Material.ROCK)); } @Override public boolean hasTileEntity(BlockState state) { return true; } @Override public TileEntity createTileEntity(BlockState state, IBlockReader world) { return SetupCommon.tileEntityType.create(); } } package net.threader.generatorsmod.init; import net.minecraft.block.GlassBlock; import net.minecraft.client.renderer.RenderType; import net.minecraft.client.renderer.RenderTypeLookup; import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent; public class SetupClient { @SubscribeEvent public static void onClientSetupEvent(FMLClientSetupEvent event) { RenderTypeLookup.setRenderLayer(SetupCommon.generatorBlock, RenderType.getCutout()); } }

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.