Jump to content

Recommended Posts

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?).

Posted

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.

Posted

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

 

 

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...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

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