Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

[Un-solved] How are blocks rendered


Zealock
 Share

Recommended Posts

Hey, i'm looking for a way to modify blocks being rendered on a client.

 

For instance i want to make certain blocks become invisible until someone gets close, a good example of what i'm trying to do is to place a barrier on the ground and change your held item to something else until the barrier on the ground goes invisible, thats what i'm going for.

 

A few things have crossed my mind and one was using a core mod and modify the BlockBarrier.class and override the (getRenderType()) method to return a variable for dynamic modification (like when a player gets close i can set it to either 3 or -1). (i believe -1 ignores rendering, 3 renders like a normal block please confirm this :) ) 

 

Whats the best way to achieve this? I'm currently using minecraft forge 1.8.9

Edited by Zealock
Going to use TESR to achieve my goal, thanks all :)
Link to comment
Share on other sites

8 hours ago, Zealock said:

A few things have crossed my mind and one was using a core mod and modify the BlockBarrier.class and override the (getRenderType()) method to return a variable for dynamic modification (like when a player gets close i can set it to either 3 or -1). (i believe -1 ignores rendering, 3 renders like a normal block please confirm this :) )

This is a horrible idea. Bad modder, no cookie.  Core mods are not allowed here.

 

I suspect the easiest way to do what you want to do will be to use a TESR, although I don't know if it would be possible using a FastTESR, but if so, that would be better.

  • Like 1

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

14 hours ago, Zealock said:

core mod and modify the BlockBarrier.class

You might have missed a pillar of Forge ideology: simply extend the class, override what methods you want to change, and use this new class...

You don't HAVE to use Barrier blocks, you WANT to use something that works like Barrier blocks.
ASM is incredibly bad if you don't know what you are doing, and as time and time again has been proven by countless users in the MC modding community, unless you have a few years of expertise, chances are that you do not.
In fact, countless core-mods could do what was stated above, and look at that, no ASM needed at all.
 

To make something go invisible, a FastTESR could be used. Override getMaxRenderDistanceSquared in the TE to return the cutoff-point for (rendering->not-rendering)². Default is 4096 (64 block / 4 chunks distance)

Simple, yet effective way of turning invisible, with minimal code required.

  • Like 1

Also previously known as eAndPi.

"Pi, is there a station coming up where we can board your train of thought?" -Kronnn

Published Mods: Underworld

Handy links: Vic_'s Forge events Own WIP Tutorials.

Link to comment
Share on other sites

Got it, coremods are a no-go thanks for clearing that up :)

 

Wont using TESR for something like this become laggy if there are a lot of blocks? if so my main goal is really to just switch the texture of a block dynamically (and don't need any animation either) when a player walks too close to zones they're not allowed in yet.

 

I couldn't really find anything that suggests I can override a vanilla block which is kind of why I walked closer towards the dark arts of core mods O.o

 

I also want to keep the server vanilla, This way I can still allow vanilla clients along with an enhanced experience if people want to try out Forge.

Link to comment
Share on other sites

2 hours ago, Zealock said:

Wont using TESR for something like this become laggy if there are a lot of blocks? if so my main goal is really to just switch the texture of a block dynamically (and don't need any animation either) when a player walks too close to zones they're not allowed in yet.

Not as bad as you're thinking. You need thousands of them.  All being rendered at the same time. If the TE itself isn't ticking, it doesn't apply any impact.

2 hours ago, Zealock said:

I couldn't really find anything that suggests I can override a vanilla block which is kind of why I walked closer towards the dark arts of core mods O.o

You're not overriding a vanilla block, you're extending it.

2 hours ago, Zealock said:

I also want to keep the server vanilla, This way I can still allow vanilla clients along with an enhanced experience if people want to try out Forge.

Hahaha no.

While you could certainly tell Forge, "the client doesn't need my mod" and the client will connect, they're not going to see all the special blocks and items you've added.  This custom barrier block thing-a-jig you're making? That requires the code to exist on the client for it to work.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

Quote

I also want to keep the server vanilla, This way I can still allow vanilla clients along with an enhanced experience if people want to try out Forge.

Hahaha no.

While you could certainly tell Forge, "the client doesn't need my mod" and the client will connect, they're not going to see all the special blocks and items you've added.  This custom barrier block thing-a-jig you're making? That requires the code to exist on the client for it to work.

Well, this is just an enhancement mod for a vanilla server minigame, which is why i wanted to modify Barriers and various other things on the forge client to behave differently to vanilla (who dont see them at all).

 

Ill use TESR/FastTESR, it does sound like the easiest way so far.

 

Sorry for mixing the terms overriding and extending you're right (extending the class, and overriding the methods), it was just my heads way of explaining what i was doing :P

 

Thanks for alerting me to TESR i probably would have done some unnecessary work if i didnt get told, saved me some future headaches 

 

Edited by Zealock
I submitted the response early, added the rest of the reply
Link to comment
Share on other sites

On 6/16/2017 at 11:53 PM, Zealock said:

Hey, i'm looking for a way to modify blocks being rendered on a client.

 

For instance i want to make certain blocks become invisible until...

Sounds like an X-ray cheat in the making. I'm surprised this thread hasn't been locked already.

Edited by jeffryfisher

The debugger is a powerful and necessary tool in any IDE, so learn how to use it. You'll be able to tell us more and get better help here if you investigate your runtime problems in the debugger before posting.

Link to comment
Share on other sites

26 minutes ago, jeffryfisher said:

Sounds like an X-ray cheat in the making. I'm surprised this thread hasn't been locked already.

Nah, he's trying to do something else. I think.

  • Like 1

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

3 hours ago, jeffryfisher said:

Sounds like an X-ray cheat in the making. I'm surprised this thread hasn't been locked already.

Quite the opposite, I'm giving barrier blocks a forcefield view/sound upon reaching close proximity.


It's an enhancement mod for a vanilla mini game I'm working on.

Link to comment
Share on other sites

So im having troubles on where to begin, i just need help getting started, i can do all the render code my self im just a little unsure on what the procedure is..

 

Is it possible to render an overlay on the barrier block using an existing block texture, such as: Rendering the overlay obsidian over the barrier using tesr?

thanks

Edited by Zealock
Link to comment
Share on other sites

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

 Share



  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • hi i made the accesstransformer.cfg file with the text it needs for what im doing, but i dont know how to refresh the gradle project, in eclipse you right click in the project, gradle and refresh gradle project but im using intellij and all the tutorials for accesstransformers are made for eclipse #AbstractClientPlayerEntity public net.minecraft.client.entity.player.AbstractClientPlayerEntity field_175157_a # playerInfo #NetworkPlayerInfo public net.minecraft.client.network.play.NetworkPlayerInfo field_187107_a # playerTextures public net.minecraft.client.network.play.NetworkPlayerInfo field_178864_d # playerTexturesLoaded public net.minecraft.client.network.play.NetworkPlayerInfo func_178841_j()V # loadPlayerTextures public net.minecraft.client.network.play.NetworkPlayerInfo field_178867_a # gameProfile  
    • i wrote the accessmodifier thing, refreshed the build.gradle file and even restarted my idle but it didnt worked, i checked the location of where the .cfg file should be but there is nothing(src/main/resources/META-INF/accesstransformer.cfg), there is only the mods.toml
    • Did you had a look at the link to the Forge doc I attached?
    • I have a server on Forge, no mods installed, version 1.16.5.  If I try to do any update on a new release the placed block values randomize.  Basically, the grass turns to rail road tracks, horses are dolphins grazing grass, chickens are fish sliding around on the grass, and the ender dragon is raining fire and hell down on the world.  It's a interesting take on the game.  However, you can't play this scrambled mess.  The block will look correct in your hand, but once place it's anyone's guess what it becomes. There is literally zombie army's marching single file LOL...So the server is currently stuck on 1.16.5 and I can't update it basically.  If I reload my backup to the version 1.16.5 all order is restored.   I have updated my account, java, and reinstalled Minecraft.  Single player works fine on new world creations....it's just this server and trying to update.  It has been updated many times in the past, as it's a couple years old...any suggestions?
    • I know this is basic java knowledge but PLEASE tell me a solution, i already learned java but i never imagined how i can use public, private and protected(obviusly i use them but i dont know how to connect private fieds so my class) im BEGGING YOU tell me how, i tried some tutorials of how to access to private fields but it wasnt helpful
  • Topics

  • Who's Online (See full list)

×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.