Add removing and updating modes to Structure Projector#38
Add removing and updating modes to Structure Projector#38ReignOfFROZE wants to merge 21 commits intoGTNewHorizons:masterfrom
Conversation
|
Bugs fixed, just need updated textures for the projector and then this should be ready to go. If someone wants to review the code itself though while those are still coming, that would be appreciated |
|
I haven't look at the code very closely. These are my feelings so far
technical issues aside, I'd be slightly cautious towards the idea of "block removal/replacement on item use". this might have some issue with 1) chunk claims 2) early game balance of miing levels. some more testings is probably required |
I'm not sure what you mean by this, I'm happy to move the method but from what I can tell AutoPlaceEnvironment is for something else entirely, the |
This totally makes sense, and I'll try to converge my code paths a bit as well as clean up some tech debt that I created with all of the diverging code paths to make the code easier to follow, |
I'll see if I can add some compat for ServerUtilities to check claims, as well as some checking to see if the block you're breaking/replacing satisfies one (or both) of these two conditions:
If neither of those conditions is satisfied, we can probably just reject the block break/replacement. |
|
Still working on the removal/replacement checks to make sure the blocks being removed are appropriate to remove, but the SU compat to prevent griefing and some code cleanup is there. I also need to update GTNewHorizons/GT5-Unofficial#4147 to use the enum that was added. |
|
This PR should be good to go now. Going to go update the GT5U PR now |
Glease
left a comment
There was a problem hiding this comment.
(still not done with a full review yet. these are so far what I get)
I honestly won't mind if survivalPlaceBlock is a switch block calling into survivalPlaceBlockBuild survivalPlaceUpdate survivalPlaceBlockRemove. This will leads to some code duplication, but the code flow will be so much easier to understand
src/main/java/com/gtnewhorizon/structurelib/structure/StructureUtility.java
Outdated
Show resolved
Hide resolved
src/main/java/com/gtnewhorizon/structurelib/structure/StructureUtility.java
Outdated
Show resolved
Hide resolved
src/main/java/com/gtnewhorizon/structurelib/structure/IStructureElement.java
Show resolved
Hide resolved
src/main/java/com/gtnewhorizon/structurelib/structure/StructureUtility.java
Outdated
Show resolved
Hide resolved
src/main/java/com/gtnewhorizon/structurelib/structure/StructureUtility.java
Outdated
Show resolved
Hide resolved
|
@ReignOfFROZE Any updates on this? |
Yeah, I've been meaning to get around to it. Just haven't yet. I'll finish this up next week (or this upcoming, depending when you start your weeks) most likely. |
The problem with doing this is that every single implementation of Edit: For 2.8 purposes, I think it might be best to leave it how it is, but I would be amenable to coming back and adding this sometime during the 2.9/whatever the next release is called dev cycle and cleaning up the code flow a bit |
Glease
left a comment
There was a problem hiding this comment.
The code probably works as is, but there are some non-technical issues that needs addressing, such as the javadoc one
Overall I'm rather disappointed with how IStructureElement#survivalPlaceBlock now needs to take on 3 different features that is at best described as mildly related, but I guess this is what we get if we don't want a thorough refactor that takes another year to do
Removal of frames from javadoc disappoints me even more 😥
src/main/java/com/gtnewhorizon/structurelib/structure/StructureUtility.java
Show resolved
Hide resolved
src/main/java/com/gtnewhorizon/structurelib/structure/StructureUtility.java
Outdated
Show resolved
Hide resolved
src/main/java/com/gtnewhorizon/structurelib/structure/StructureUtility.java
Outdated
Show resolved
Hide resolved
src/main/java/com/gtnewhorizon/structurelib/item/ItemConstructableTrigger.java
Outdated
Show resolved
Hide resolved
|
@Glease aceptable for you ? |
This is related to GTNewHorizons/GT5-Unofficial#4147.
Still a WIP so leaving in draft(sprites are also going to change, those were purely just so I could tell the difference)Also related to GTNewHorizons/StructureCompat#13
In short, this PR adds "Updating" and "Removing" modes to the Structure Projector (ItemConstructableTrigger). These modes work as follows:
The reason this PR is still in draft is because there's one slight bug with the interactions it has with an already built multi, where it will always try to replace anything that isn't a casing when in update mode, including, most notably, removing hatches on the multi (even if they're allowed to be there). I'm trying to debug it, hence all of the random System.outs and the throwables to check stacktraces of how these methods are even getting called, and if anyone has any information that can help, that would be much appreciated (more context here https://discord.com/channels/181078474394566657/603348502637969419/1358946773904785508 and here https://discord.com/channels/181078474394566657/603348502637969419/1358947157146599514). The skip logic here: https://github.com/GTNewHorizons/GT5-Unofficial/blob/58b37d4ded66fc4df4eb3aab6978a8d9bd0f2b85/src/main/java/gregtech/api/util/HatchElementBuilder.java#L504-L505works, but for some reason it's calling both the
survivalPlaceBlockmethod inHatchElementBuilderand the default one provided in StructureLib.Other than that one bug (which I'm apprehensive to mark this PR as ready to merge until it's fixed, as it's sort of major considering it would be a decently annoying thing to deal with in an actual playthrough), the rest of the PR (except the sprites) is mostly ready to go and should be ready for wider testing.