Skip to content

Add Range Display to Mega Torch and Dread Lamp#270

Open
Syer10 wants to merge 1 commit into
Xalcon:mc/1.21.1from
Syer10:range
Open

Add Range Display to Mega Torch and Dread Lamp#270
Syer10 wants to merge 1 commit into
Xalcon:mc/1.21.1from
Syer10:range

Conversation

@Syer10
Copy link
Copy Markdown

@Syer10 Syer10 commented May 6, 2026

GUI

javaw_2026-05-05_23-33-20

Inside Range

javaw_2026-05-05_23-33-53

Outside Range

javaw_2026-05-05_23-34-04

Notes

  • There is some z-fighting when blocks merge
  • Its enabled per-mega torch server-wide, so everyone can see the range display when enabled
  • It works with shaders (Tested with Iris)

@Xalcon
Copy link
Copy Markdown
Owner

Xalcon commented May 6, 2026

Thank you for this PR.

I have a very basic client-side-only implementation in 1.20, but i was never super happy with how it works, especially when multiple torches overlap.

I dont have much time during the week, I'll take a closer look on the weekend - but I'm unsure what you mean its server wide. Each player still has to explicitly enable it in the settings - but it will show all torches? Or will you need to toggle it per torch?

Either way, I'll try to find some time this weekend to review this.

@Syer10
Copy link
Copy Markdown
Author

Syer10 commented May 6, 2026

Each Torch now has a GUI that enables the range preview, the range preview is then shown to all players since it's a part of the Torch itself, and not the client.

@mnfu
Copy link
Copy Markdown

mnfu commented May 11, 2026

Each Torch now has a GUI that enables the range preview, the range preview is then shown to all players since it's a part of the Torch itself, and not the client.

Just my two cents as someone with no stake in this: this feels more like a client-side visualization feature (similar to light overlay mods), so it might make more sense as a per-player toggle rather than being visible to everyone. Having it global could be intrusive depending on server use.

@Xalcon
Copy link
Copy Markdown
Owner

Xalcon commented May 11, 2026

Each Torch now has a GUI that enables the range preview, the range preview is then shown to all players since it's a part of the Torch itself, and not the client.

Just my two cents as someone with no stake in this: this feels more like a client-side visualization feature (similar to light overlay mods), so it might make more sense as a per-player toggle rather than being visible to everyone. Having it global could be intrusive depending on server use.

Your concerns are valid and thats how I implemented it in the 1.20 version, fully clientside - but just to make sure, this PR doesnt automatically render the box for all players on a server. Each player needs to enable the volume rendering first in the settings and then it will show. The only thing that is server side, is which volumes are displayed when a player enables the rendering.

Its one of the reasons why I've not merged it yet. I'm not sure if I like it. Its not necessarily bad, but I want to avoid unnecessary synchronization between server and client for a client-side only feature. Since I have bigger plans for mc v26+, I think I'll simply merge this as is, just to get the feature in and redesign torchmaster from scratch. A lot of design decisions in the core of torchmaster limit capabilities I wanted to implement for ages now.

I need to think about this for a bit longer. I didnt find time on the weekend, but I do have a day off on thursday, so thats when you can expect to see some movement in this feature.

@Xalcon
Copy link
Copy Markdown
Owner

Xalcon commented May 14, 2026

@Syer10 I've spent some time now reviewing the code. Quality overall looks good, but I'm not a fan of the general implementation. Personally, I like to keep load off servers - and generally not share information if other sources dont care about it. I'm aware that two more blockstates and an update on interaction isnt a lot, but it adds up if a lot of mods do it. Also, this PR touches 27 files because it not only adds the rendering but also networking and blockstate sync and persistence.

1. Multiplayer share the same state

I dont like the idea that we effectively force the visualisation state onto all connected clients in multiplayer. It seems I initially misunderstood this as well. It seems, a player can enable the visualisation and other players cant disable it just for themselves. I thought there would be an ingame setting that allows to do this, but this seems to not be the case. Its either On of Off for all players. Let me know if I miss something.

2. Client Side Cache with active scan

I'll be honest, i dont think we should have this. The scanner actively searches through all blocks on chunkload all the time, just because it wants to build a cache. I understand why you implemented it: Its so a visualisation is displayed in case the chunk was not loaded while the state changed. If we go with the concept that a visualisation is per client and we accept that it resets on disconnect or restart, we can get rid of the whole scanning, blockstates and and only need a small cache for the renderer. The server and other clients dont need to know what a specific client is doing.

3. Networking

The visualisation is synced to the clients using a custom network packet. This is generally a clean implementation but we could've considered syncing a server side cache to the client, to prevent unnecessary client side scans of whole chunks. But networking becomes entirely needless if we go with a clientside only solution. I will still go with a network implementation because this allows me to implement hiding and showing visualisations via commands at a later point.

4. Hardcoded for Megatorch

At the moment, the code is limited to just the mega torch - but I think, both the Dread Lamp and the Feral Flare Lantern would heavily benefit from this feature as well.

Dont get me wrong, I appreciate your work and I think I want to re-use some of your code - but I wont be merging this as is. I'll probably take some of your GUI code and some other bits and pieces and instead take my 1.20 implementation and port it to 1.21 - if that is okay with you. (GUI has always been a pain point for me)


Just a general question, as I've not been following which versions of MC 1.21 are very active: Besides 1.21.1, are there other 1.21.x version I should port this too? I've been playing only 1.20.1 for the most part and I didnt spent much time in 1.21 myself.

Either way, I hope you are not angry at me for not merging this. I appreciate your involvement and it shows me that people still care about this mod, which motivates me to keep working on it.

sneak peek:
image

@Syer10
Copy link
Copy Markdown
Author

Syer10 commented May 14, 2026

No problem, as long as there is work being done on this feature I'm happy 😄

1.20.1 is where most major modpacks are targeting, so it should be the main version you develop on. I am currently playing Direwolf 1.21. I used my fork for my server so me and my friends could optimize our Mega Torch placement around our base.

Love the preview! Looking forward to when I don't need to send my friends jar files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants