-
Notifications
You must be signed in to change notification settings - Fork 5
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 config support for generating tower #38
base: 1.20
Are you sure you want to change the base?
Conversation
Hi @yungnickyoung, thoroughly enjoy your mods. I created this PR as a way to support a config option to determine if the tower structure is regenerated on each dragon death. Prohibiting the regeneration of the structure allows for semi and fully automated processes to kill the dragon. Please let me know what feedback you have! |
Hi @yungnickyoung, any thoughts on this PR? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey! Thanks for this, this looks really promising.
Out of curiosity, have you tested this when applied to a world previously using an older version of Better End Island? If we merge this change, a lot of users will be updating their existing worlds to use the new version, so I'd want to make sure it doesn't cause any problems.
On a similar note, I was also wondering if you've done any compat testing with other End- or dragon-related mods, or if you just have any thoughts on the matter in general. I'd love to hear your insight.
level.explode(null, this.portalLocation.getX(), this.portalLocation.getY(), this.portalLocation.getZ(), 6.0F, Level.ExplosionInteraction.NONE); | ||
this.spawnNewGateway(); | ||
if (!this.previouslyKilled || BetterEndIslandCommon.moreDragonEggs || BetterEndIslandCommon.CONFIG.resummonedDragonDropsEgg) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How come the check for BetterEndIslandCommon.CONFIG.resummonedDragonDropsEgg
was removed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, that was an inadverent change. Will add back.
Thanks for the response! I had not tested an old version and how that would react to this update. Will go through several scenarios for that. I'm not as familiar with existing end mods. Are there several that you would recommend me to ensure compatibility with? Otherwise, I can try to do a Curseforge search later this evening. I imagine if they are modifying the dragon fight event this mod would already have some compatibility issues depending on the changes. Structural changes, as long as they're not modifying the end podium placement after the first initial placement should be fine. If they modify the structure of the podium (i.e. instead of being a circle, it becomes a triangle) there would also be incompatibility due to the static placement of the end portals. If a mod is doing that however, I'd expect them to have logic to remove placed podiums since they'd be overriding Minecrafts native placement. I believe Slient Gear does flower placement after the dragon is killed, which I'll test with. I wouldn't anticipate that to impact this, unless they are attempting to place flowers where the tower structure is being placed and the regenerate config is true. Those would be replaced, but that would happen today. |
Will this be released? |
Overview
The purpose of this PR is to address issue #18. A config option is added that will allow a user to determine if the tower over the end podium is generated on subsequent dragon kills.
Changes
A config option labeled
regenerateTowerOnDragonDeath
was added to determine if the tower structure placement should take place after a dragon kill. This config option was added for both Forge and Fabric, as well as within the commonConfigModule.java
Within
EndDragonFightMixin.java
, the method signature forbetterendisland$spawnPortal
was updated to include a third boolean parameter. This value determines if the tower placement takes place.There are three instances where this value is passed in as true, regardless of the configuration value:
The main changes take place within the
betterendisland$spawnPortal
method. Namely the logic follows the flow of:isActive
is true. Additionally, utilization ofhasActiveExitPortal
combined withisActive
will ensure that we're not re-creating the exit portal if it already exists.isActive
is true andhasActiveExitPortal
is false we "activate" the exit portal by placing end portal blocks following the structure construction of the exit portal, though focused on placing only the end portals. A coordinate array is used to determine where end portals should be placed relative to the portal position block (though three below to ensure they are placed in the exit portal ring).Testing
Testing was done using the debug functionality within IntelliJ for both Forge and Fabric. The scenarios tested included ensuring initial tower was placed on first spawn, broken blocks were not replaced on subsequent dragon kills with config value set to false, and experience was consistent as before with config value set to true.