Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Shadow (Echo?) Ploy #12

Merged
merged 25 commits into from
Jul 4, 2024
Merged

Add Shadow (Echo?) Ploy #12

merged 25 commits into from
Jul 4, 2024

Conversation

StellarWitch7
Copy link
Collaborator

Add a glyph that takes a vector and a block type and makes it appear as if there is a block of that type at that position regardless of what is actually there.

Internally references these blocks as shadow blocks, but echo may be more appropriate?

Very WIP, non-functional.

@enjarai
Copy link
Owner

enjarai commented Jul 3, 2024

To do:

  • Fix sodium compat
  • Make disguise break when underlying blockstate is changed
  • Remove the debug shadow block i left in at 0 0 0 of each chunk ;-;

@StellarWitch7
Copy link
Collaborator Author

Fulfilled TODO 2-3.

@StellarWitch7
Copy link
Collaborator Author

Added Revelation Ploy to dispel shadow blocks programmatically.

@StellarWitch7
Copy link
Collaborator Author

Added Iteration Stratagem glyph, to iterate over a list of values.

@StellarWitch7
Copy link
Collaborator Author

Got Shadow Ploy to work with Sodium and most solid blocks. It appears to have trouble with blocks that have transparency or more complex models, but I've not experimented with it enough to say whether it's an issue with both or only one of those.

@StellarWitch7
Copy link
Collaborator Author

Unfortunately the inject point when Sodium is loaded doesn't have an easy way that I can see to cache the CCA component associated with any chunk, so we're looking up the CCA component every time the block state is fetched through the target method by Sodium's renderer.

Though I'm sure the benefits of Sodium will more than make up for that extra lookup.

@StellarWitch7
Copy link
Collaborator Author

After doing a bit more testing, I've found that the only issue is either making a solid block have a shadow that is not solid, or at a specific Y level, trying to place a shadow block on short grass. If the shadow block type is transparent, it appears to do nothing. If the shadow block is solid, it makes the short grass lose light.

Short grass as sand at the problematic Y level:
image

Short grass as oak leaves:
image
The two oak leaves there are short grass, and the two short grass one block above are also disguised as oak leaves.

Either one block above or one block below and there is no issue.
Pumpkins as well as other transparent blocks seem to have issues at that Y level.

There is also sugar cane:
image
This one only appears to be the blocks that aren't touching the ground which cannot be concealed.

Some of these issues may be Sodium-independent, I haven't checked each one. However I never noticed them before enabling Sodium.

The Y level is 64, standing as a player on a full block. Checked using F3.

For some blocks, nearby block updates--using the same rules as redstone shenanigans--will cause the shadow block to render. This is not the case for short grass. It is the case for chests. For pumpkins, the shadow block can disappear due to block updates.

Sorry for the long comment, just though I'd put this down here in case you decided to mess around with this and I'm not here.

@StellarWitch7
Copy link
Collaborator Author

Shadow blocks now fulfill their name.

@StellarWitch7 StellarWitch7 marked this pull request as ready for review July 4, 2024 20:51
@enjarai enjarai merged commit d709c59 into enjarai:master Jul 4, 2024
1 check passed
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.

2 participants