stackotter / delta-client

An open source Minecraft Java Edition client built for speed.
https://deltaclient.app
GNU General Public License v3.0
322 stars 33 forks source link

Gamemode dependent block outline rendering. #138

Closed gracien-app closed 1 year ago

gracien-app commented 1 year ago

Description

This PR fixes the case where blocks are given target outlines when player's current gamemode is Spectator mode.

Block targetability is determined in function returning targeted block position. Returning nil value in aforementioned function naturally prevents rendering of block outline in worldRenderer main render loop (no block position data available).

Initial approach was to use computed variable in worldRender, however, proposed solution seemed much more elegant (single thread-safe player data fetch).

Fixes #137

Type of change

Please delete options that are not relevant.

Checklist:

stackotter commented 1 year ago

I'll just wait for the build action to finish before merging just in case