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.

Featured Replies

Posted

I'm making custom leaves and I would like to make leaves opaque when needed, but I have no idea how to get a players graphics level.

I've tried Minecraft.isFancyGraphicsEnabled() but that only works in singleplayer (why is isOpaqueCube() needed in multiplayer?).

Minecraft.isFancyGraphicsEnabled() is perfectly good way to do this.

 

To get this boolean on server side you will need to make request-answer system using packets.

Server -> askForBoolean -> Client gets it -> sendAnswer -> Server does stuff.

Or other way around.

Note that anything that makes server dependent on client is cheatable (not that anyone would write cheat to mods... xD)

 

Btw. i have no idea why would you need Fancy graphics to do it..., proper way would be make block with custom renderer and value stored inside metadata. Let's say meta == 0 render this, else render other, where one is opaque, second is not. If you need player-dependent view then you will ofc need IExtendedEntityProperties.

 

At this point I have no idea what exacly you want, so please write when and why should leaves display differently.

1.7.10 is no longer supported by forge, you are on your own.

this is probably what makes them render transparent or not transparent

 

    @Override

    public boolean isLeaves(IBlockAccess world, int x, int y, int z)

    {

        return true;

    }

 

if you are doing custom rendering my advice would be to add a setting to your mods configuration and an option so the client can toggle it

 

 

 

 

as to why isOpaqueCube is needed for multiplayer, i will explain the difference between multiplayer and singleplayer

multiplayer is the client running without a server in the background and connected to an ipaddress

singleplayer is the client running with a server in the background and connected directly to that server

 

isOpaqueCube  is used by the client to determine which blocks do not need to be rendered

 

 

  • Author

thanks! I tried using setGraphicsLevel before but it didn't work(I just tried to use the two fields but that didn't work of course), but now it does :D

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

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.