Little Tiles Partial Compatability#520
Open
milkev wants to merge 1 commit intoryanhcode:mainfrom
Open
Conversation
When VoxelShapeMixin.sable$allBoxes is called in a context relevant to little tiles, it will always be null. I added some null checks for this, and just skip over the relevant code if it is null. This results in little tile blocks being placeable and visible on physics objects, however little tile blocks are completely ignored for physics object collision checks
|
Surely this would be something good to have for all sorts of weird mod compatabilities |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The Issue I'm Trying to Fix
Little Tiles incompatability. It crashes when physics objects have little tiles on them and an entity collides with the physics object. Notably no crash occurs when physics objects collide with little tiles in the "real world", they just simply treat the little tiles as if they dont exist.
What I Did
When VoxelShapeMixin.sable$allBoxes is called in a context relevant to little tiles, it will always be null. I added some null checks for this in entity collision, and just skip over the relevant code if it is null.
The Results
This results in little tile blocks being placeable and visible on physics objects, however little tile blocks are completely ignored for physics object collision checks. (same as when a physics object collides with little tile blocks in the "real world")
I have not tested little tiles advanced functionality as I dont have experience working with that stuff in the first place, I just make visual stuff.
Little Tiles on physics objects do not render upon first entering a world, requiring a little tile to be modified on the physics object to make little tiles on that physics object visible again.
Little Tiles are also not highlightable or breakable by hand while on physics objects. They can still be modified by little tiles tools and premade structures can be placed.
Little Tiles in the "real world" are not affected at all (from my testing) by these changes.
Other Options
Option 1: A better (but still easier than full compatability) option would be to prevent Little Tiles from being placed on physics objects in the first place. However, doing so via preventing placement via canPlace doesnt work due to LittleTiles placement logic not obeying canPlace. (And I'm not smart enough to figure out how their placement logic works). If there is a way to prevent certain blocks or block types from existing on Sub-Levels on a deeper level that would be better (and honestly a great addition, gonna make a relevant issue for this)
Option 2: Instead of skipping the relevant code, generate a full-box collision for little tiles. Depending on opinion, this may be better than them having no collision. I'm whatever either way I just dont know how to do this.