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

1.12.2 TileEntity render-fix + Directional block support for a few parts #490

Open
wants to merge 16 commits into
base: 1.12
Choose a base branch
from

Conversation

Burchard36
Copy link

This fixed an issue for: #155

As well as for any other Tile Entities affected by this (Basically all Tile Entities that get placed by the world gen)

This fix is explained in readme.md but basically, it simply adds a flag to Palettes that lets you tell the mod that a certain character is a Tile Entity, once marked it goes through the same todo's as chests and spawners and runs TileEntity#markDirty(), which triggers a comparator output update based on the code that I can see when viewing TileEntity's source code (Not to be confused with input, this fix does NOT interact with the TileEntities)

If a block that is marked as a TileEntity is NOT a TileEntity; the mod will simply ignore it and not trigger the update (If it doesn't in this commit it will next commit). Though end users should really use caution that they aren't adding this flag to say the actual building blocks; I haven't tested that yet so who knows what it does, maybe nothing?

I'm going to add more smooth edges to this fix, as well as remove the debug logs but for now; this can be compiled and tested (hopefully) seamlessly

This fix also bumps build.gradle's forge version, Gradle Version, and forge gradle version. All have been tested extensively, I even looked into this: #295 and can confirm I do not experience any crashes when I /kill myself or die in any sort of manner

Also sorry... the spacing changed from LF to CLRF because it seems the old dev environment was on Linux and I'm on windows; Only annoyance is that it marked every file as saying I did something to them

Most of the fixes are in the "Major Changes" commit

1) This removes OptimizedChunkGen as I simply can't get this class converted to the new Forge API

2) Converted this project to gradle 7.4.2

3) Re-make the build.gradle

4) Change multiple dependencies in build.gradle, they are as follows:

    - Forge Gradle bump to 5.1.+
    - Forge version has been bumped to 14.23.5.2859
    - remove sme depenencies as they are now dead mods, or theyre repos are dead, or simply because this mod didnt use them

5) Add a .gitignore

6) Line endings changed to CRLF as I am on windows (grr)

7) Added a fix for Tile Entitys not rendering until they have been hovered over
AT is fixed, the field is now publicly accesible
@Burchard36
Copy link
Author

Tomorrow I will do refactoring & remove debug logs; but for now, this is perfectly good to clone and test if anyone wants to (See readme.md of the project to see how this fix works)

I hope to add automatic checking of TileEntities but I doubt this is possible because Minecraft doesn't realize a TileEntity is really there until it's interacted with/marked as dirty, though I will give my attempts tommorrow!

Allow characters to have a field called "highwayX" and "highwayZ". If this character gets used inside of any type of Highway part, it will use the X or Z block state specified; if no "highwayX" or "highwayY" is specified it will fall back onto the default "block"
@Burchard36
Copy link
Author

After mangling with this for a few hours I've noticed that on very rare occasion on 2x2 buildings some floors fail to register that they have a TileEntity and act like they did before the bug; though even on the floor with 5 TileEntities only 1-2 fail to register this way, so maybe this is some type of lag as I am only testing on singleplayer ATM soon ill send this mod over to some of my friends and they can try it out

For everything else though; all renders well 👍

This bug also seems to strictly only effect the most north western chunk of the 2x2; I will implement some fix today maybe 2x2's have seperate code for generating loot that I missed! (The patch for the TileEntities is added in generateLoot; it seemed right to process it there)

1) Removed debug warning message as it can be safely ignored now

2) Fixed a bug with directional highways where Z facing highways didnt get theyre blocks transformed
@Burchard36
Copy link
Author

Burchard36 commented Oct 3, 2022

My most recent commits are for directional highways; from the commit:

Allow palette characters to have a field called "highwayX" and "highwayZ". If this character gets used inside of any type of Highway part, it will use the X or Z block state specified combined with the facing direction of the given highway; if no "highwayX" or "highwayY" is specified it will fall back onto the default "block"

Example:
image

Currently only supports block types with Block metas for the directional settings, NBT/Other mod support can be added later

Example:

{
        "char": "r",
        "block": "minecraft:web",
        "damaged": "minecraft:iron_bars",
		"highwayZ": "scm:darkroad_cornerb_stone@3",
		"highwayX": "scm:darkroad_cornerb_stone@5"
      }

The event i added in this commit is being scrapped; originally i was gonna do that and handle my fix in a seperate mod but this seemed like a better & more lightweight choice

Expanded upon the foundation of "directional blocks" Blocks can now have a "_<direction>" (typically north south east west) to allow for other parts that support directions to use that block when the part is facing a certain direction! (used only in building fronts currently)
@Burchard36 Burchard36 changed the title Add a fix for Tile Entitys in 1.12.2 not rendering until being looked at 1.12.2 TileEntity render-fix + Directional support for a few parts Oct 3, 2022
@Burchard36 Burchard36 changed the title 1.12.2 TileEntity render-fix + Directional support for a few parts 1.12.2 TileEntity render-fix + Directional block support for a few parts Oct 3, 2022
Fixed a bug with crashing the mod after adding directional parts; all works good now
TODO: Code cleanup & Debug logs removal
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.

1 participant