Jump to content
  • Home
  • Files
  • Docs
Status Updates
  • All Content

  • Advanced Search
  • Existing user? Sign In  

    Sign In



    • Not recommended on shared computers


    • Forgot your password?

  • Sign Up
  • All Activity
  • Home
  • DonutPixel

DonutPixel

Members
 View Profile  See their activity
  • Content Count

    4
  • Joined

    November 28, 2020
  • Last visited

    December 30, 2020

Community Reputation

0 Neutral

About DonutPixel

  • Rank
    Tree Puncher
  1. DonutPixel

    Having some issues with block transparency/opacity

    DonutPixel replied to DonutPixel's topic in Modder Support

    Thank you for the tip; I'll edit my code so as to not mislead other folks.
    • November 28, 2020
    • 6 replies
  2. DonutPixel

    Having some issues with block transparency/opacity

    DonutPixel replied to DonutPixel's topic in Modder Support

    If anyone was curious; I ended up actually finding source code for ExtraUtilities and found that the original developer was manually setting the opacity of the block to 255. That was done in 1.12.2, so the translation is a little different for 1.16.2. Anyways, I'd be mad if I came across this post as solved without an answer, so here's a detailed answer/explanation: To make a block see-through, but not let light through, you must override the getOpacity method and make it return 255. This makes the block "opaque," while still allowing the player to see through. To solve rendering culling issues, you must also override the isSideInvisible method, and make it return true only if the adjacentBlockState matches this block's state. In code, the following two overrides look like this: @Override public boolean isSideInvisible(BlockState state, BlockState adjacentBlockState, direction side) { // if the adjacentBlock is this block, side should be invisible. else, false return adjacentBlockState.isIn(this) ? true : false; } @Override public int getOpacity(BlockState state, IBlockReader worldIn, BlockPos pos) { // NOTE: I'm not sure if this really has to be 255, or if there's a lower value at which this blocks all light. return 255; } Additionally, in the creation of the Block's properties, you should tack .notSolid() onto the list.
    • November 28, 2020
    • 6 replies
  3. DonutPixel

    Having some issues with block transparency/opacity

    DonutPixel replied to DonutPixel's topic in Modder Support

    That guide is fantastic; thanks for the link! I actually found your project a little earlier this morning; great stuff!
    • November 28, 2020
    • 6 replies
  4. DonutPixel started following Having some issues with block transparency/opacity November 28, 2020
  5. DonutPixel

    Having some issues with block transparency/opacity

    DonutPixel posted a topic in Modder Support

    I'm a developer by trade but just recently picked up Java/Minecraft Modding, so I'm still relatively new to this. I'm trying to replicate the Dark Glass block from the Extra Utilities mod. I have the block rendering in the game, however, when placed, all adjacent blocks are missing their textures and show a gap in the world. This can be fixed by adding .notSolid() to the properties of the block, but at that point, the block lets light through. My desired effect is to have a translucent block (think stained glass but darker) that you can see through, but that doesn't let light through. Here's my code for the Block's class: public class DarkGlassBlock extends Block { public DarkGlassBlock() { super(Properties.create(Material.GLASS) .hardnessAndResistance(1.0f, 50.0f) .sound(SoundType.GLASS) .harvestLevel(1) .harvestTool(ToolType.PICKAXE)); } } And code to set the Render Layer to Translucent (in my FMLClientSetupEvent method): RenderTypeLookup.setRenderLayer(RegistryHandler.DARK_GLASS_BLOCK.get(), RenderType.getTranslucent()); I also attached a screenshot that better demonstrates the issue. Thanks in advance! Side note -- Does anybody know of any updated tutorials for mod development? A lot of resources that seem great appear to be outdated for 1.16 development.
    • November 28, 2020
    • 6 replies
  • All Activity
  • Home
  • DonutPixel
  • Theme

Copyright © 2019 ForgeDevelopment LLC · Ads by Longitude Ads LLC Powered by Invision Community