Posted June 17, 20178 yr 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 June 19, 20178 yr by Zealock Going to use TESR to achieve my goal, thanks all :)
June 17, 20178 yr Author Even if you have other ideas on modifying vanilla blocks rendering, but don't know how the rendering works, id still like to see your feedback
June 17, 20178 yr 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. 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.
June 17, 20178 yr 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. 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.
June 18, 20178 yr Author 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 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.
June 18, 20178 yr 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 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.
June 18, 20178 yr Author 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. Like this Quote 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 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 June 18, 20178 yr by Zealock I submitted the response early, added the rest of the reply
June 18, 20178 yr 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 June 18, 20178 yr 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.
June 18, 20178 yr 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. 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.
June 18, 20178 yr Author 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.
June 19, 20178 yr Author 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 June 19, 20178 yr by Zealock
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.