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

Finish implementing deleting unloaded tiles feature, add VanillaFallbackOnModDeletion examples #4325

Draft
wants to merge 1 commit into
base: 1.4.4
Choose a base branch
from

Conversation

JavidPack
Copy link
Collaborator

@JavidPack JavidPack commented Jul 30, 2024

When a user decides to disable a mod, that mod will leave unloaded tiles in the world. If the user wishes to permanently remove a mod, then the tiles are a nuisance. The code exists to do this, replacing those tiles with VanillaFallbackOnModDeletion, but the code currently will not run because it is not hooked up to any UI for the user to click.

This PR also will add proper VanillaFallbackOnModDeletion usage and also update the documentation to warn about how to correctly use VanillaFallbackOnModDeletion.

TODO:

  • Do we also need to remove items from chests? Modded storages? Inventories? It seems like this could get complicated quickly and isn't quite as difficult for the user to manage themselves.
  • How should this effect be triggered? It's a rare desire, so we don't want users to accidentally press it or be confused by it. If we can't decide on a UI, a hidden keypress like holding shift can trigger this and we can just mention this to anyone who asks.

Example

In this example several tiles are replaced with suitable alternatives via VanillaFallbackOnModDeletion usage. ExampleTorch (bottom middle, near the player) shows the default behavior of turning back to dirt. ExampleWallAdvanced shows the default wall behavior, turning to air. ExampleChair, Chest, Block, Sign, Platform, Ore, Bar all revert to a vanilla tile in this example. On the left is TileObjectDataShowcase, which uses different FrameX and FrameY values from a normal 2x2 tile. This shows how a modded might make a mistake if they use VanillaFallbackOnModDeletion on a tileframeimportant tile that does not exactly match the layout of the vanilla tile they intend to fallback to.

Before:
2024-07-30_12-36-07

Unloaded:
2024-07-30_12-35-02

Deleted and replaced:
2024-07-30_12-39-50

@Chicken-Bones
Copy link
Member

Chicken-Bones commented Jul 30, 2024

Removing items from storages would be a good option to provide, but isn't needed in the initial implementation. Items are much easier for the player to manage themselves.

@Solxanich
Copy link
Collaborator

As far as modded chest to regular chest goes,
If my memory serves the contents are preserved if it goes from a chest to a different chest. It's why unloaded chest works.

An alternative question is if the VanillaFallback type needs to default that modded chests fallback to wooden chests?

@JavidPack
Copy link
Collaborator Author

We could do wooden chests specifically, or try to have all tiles default to style 0, but that might be hard to implement. The fallback feature is a really rare situation and I don't want every mod with content thinking they need to spend multiple lines declaring a fallback tile and tile style for all modtile.

I think keeping it simple is fine, if someone ends up with a locked golden chest, I think that might be better than a selection of different chest style all turning into the same wooden chest. That said, most mods don't even use tile styles so most will be wooden chests anyway.

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