Jump to content

Recommended Posts

Posted (edited)

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 :)
Posted
  On 6/17/2017 at 6:53 AM, 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 :) )

Expand  

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.

Posted
  On 6/17/2017 at 6:53 AM, Zealock said:

core mod and modify the BlockBarrier.class

Expand  

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.

Posted

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.

Posted
  On 6/18/2017 at 12:49 AM, 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.

Expand  

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

Expand  

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.

Expand  

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.

Posted (edited)
  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
Posted (edited)
  On 6/17/2017 at 6:53 AM, 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...

Expand  

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.

Posted
  On 6/18/2017 at 6:22 PM, jeffryfisher said:

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

Expand  

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.

Posted
  On 6/18/2017 at 6:22 PM, jeffryfisher said:

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

Expand  

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.

Posted (edited)

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

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



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • That is incorrect. Use the run.bat or run.sh to run the server.
    • Hello, I have been trying for days to create my server with forge-1.20.1-47.4.1-installer, which installs the server, but the forge-1.20.1-47.4.1.jar file, which is necessary to create the server, does not appear. I no longer know what to do. Help. hola buenas, llevo dias intentando poder hacer mi servidor con forge-1.20.1-47.4.1-installer el cual instalo el server, pero no aparece el archivo forge-1.20.1-47.4.1.jar , el cual es necesario para poder crear el server, ya no se que hacer ayuda.
    • Does this happen if you use the regular vanilla minecraft launcher? Also, unsure if TLauncher ever has a legit usage, as I have always seen it associated with software piracy, but if it has a legit mode, make sure it is using online mode so that it can authenticate your MS account to login. Aside from that, more information is likely needed. Post logs, as well as the paths you are placing files in (screenshots of your file explorer can be helpful as well).
    • I am using a third-party launcher that has pre-installed forge versions of Minecraft.  When I insert mods from CurseForge, I extract the files and as expected put them in the .mods folder. I am guessing that there is an error with the file transfer but I don't know for sure and sometimes I use Forge to test mods that I created before releasing previously on a different pc, so I don't know if it is the if it an extraction error but if are any tips or knowledge reply and I will read it. This is also will be kept on the forum for others that have the issues.
    • I make wires and i need connection 2 wires block. I have BooleanPropertys registered, but in mod loading it show Unknown the property in assets/wuntare/blockState. public static final BooleanProperty CONNECTED_NORTH = BooleanProperty.create("connected_north"); public static final BooleanProperty CONNECTED_SOUTH = BooleanProperty.create("connected_south"); public static final BooleanProperty CONNECTED_WEST = BooleanProperty.create("connected_west"); public static final BooleanProperty CONNECTED_EAST = BooleanProperty.create("connected_east"); public static final BooleanProperty CONNECTED_UP = BooleanProperty.create("connected_up"); public static final BooleanProperty CONNECTED_DOWN = BooleanProperty.create("connected_down"); public CopperWireWithoutInsulation0(Properties properties) { super(properties); this.registerDefaultState(this.stateDefinition.any() .setValue(CONNECTED_NORTH, false) .setValue(CONNECTED_SOUTH, false) .setValue(CONNECTED_WEST, false) .setValue(CONNECTED_EAST, false) .setValue(CONNECTED_UP, false) .setValue(CONNECTED_DOWN, false)); } @Override protected void createBlockStateDefinition(StateDefinition.Builder<Block, BlockState> builder) { builder.add(CONNECTED_NORTH, CONNECTED_SOUTH, CONNECTED_WEST, CONNECTED_EAST, CONNECTED_UP, CONNECTED_DOWN); } In this part blockState have problem "multipart": [ { "apply": { "model": "wuntare:block/copper_wire_without_insulation0" } }, { "when": { "connected_north": true }, "apply": { "model": "wuntare:block/copper_wire_without_insulation0_north" } },  
  • Topics

×
×
  • Create New...

Important Information

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