-
-
Notifications
You must be signed in to change notification settings - Fork 109
Dragon tags & mechs #2620
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
Dragon tags & mechs #2620
Conversation
paper/src/main/java/com/denizenscript/denizen/paper/properties/PaperWorldExtensions.java
Show resolved
Hide resolved
paper/src/main/java/com/denizenscript/denizen/paper/properties/PaperWorldExtensions.java
Show resolved
Hide resolved
| if (!mechanism.hasValue()) { | ||
| battle.spawnNewGateway(); | ||
| } | ||
| if (mechanism.requireObject(LocationTag.class)) { |
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.
else if
| // --> | ||
| tagProcessor.registerMechanism("respawn_dragon", false, (object, mechanism) -> { | ||
| if (object.getWorld() == null) { | ||
| mechanism.echoError("World '" + object.world_name + "' is unloaded, cannot set respawn phase."); |
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.
... when is this a real concern?
| // <--[mechanism] | ||
| // @object WorldTag | ||
| // @name respawn_phase | ||
| // @input ElementTag(String) |
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.
just ElementTag
| // @returns ElementTag(Number) | ||
| // @description | ||
| // Returns the number of end gateway portals. | ||
| // Only works in end worlds. |
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.
Minor nitpick, but in sounds more like the player being in an end world while the script is running or something - maybe on, for, if the world is an end world, etc.?
| // @attribute <WorldTag.healing_crystals> | ||
| // @returns ListTag(EntityTag) | ||
| // @description | ||
| // Returns a ListTag of the healing crystals located on top of the obsidian towers. |
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.
I'd mention ender/end crystals as a search aid or in the description somewhere, healing crystals is technically right but most people probably won't know them by that name.
| }); | ||
|
|
||
| // <--[tag] | ||
| // @attribute <WorldTag.healing_crystals> |
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.
Wrong tag name
| // @Plugin Paper | ||
| // @group paper | ||
| // @description | ||
| // If no location is specified, tries to spawn a new end gateway using default game mechanics. Otherwise, spawns a new end gateway portal at the specified location. |
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.
Nitpick, but meta is usually the other way around (spawns gateway at specified location, specify no input to spawn vanilla one)
| battle.spawnNewGateway(); | ||
| } | ||
| else if (mechanism.requireObject(LocationTag.class)) { | ||
| battle.spawnNewGateway(mechanism.getValue().asType(LocationTag.class, mechanism.context)); |
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.
There should be a #valueAsType iirc?
| // @name respawn_phase | ||
| // @input ElementTag | ||
| // @description | ||
| // Set the current respawn phase of the ender dragon. Valid phases can be found at <@link url https://jd.papermc.io/paper/1.20/org/bukkit/boss/DragonBattle.RespawnPhase.html> |
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.
Link doesn't seem to work?
| tagProcessor.registerMechanism("respawn_phase", false, ElementTag.class, (object, mechanism, input) -> { | ||
| DragonBattle battle = object.getWorld().getEnderDragonBattle(); | ||
| if (battle == null) { | ||
| mechanism.echoError("Provided world is not an end world!"); | ||
| return; | ||
| } | ||
| battle.setRespawnPhase(input.asEnum(DragonBattle.RespawnPhase.class)); | ||
| }); |
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.
Needs Mechanism#requireEnum
|
|
||
| // <--[mechanism] | ||
| // @object WorldTag | ||
| // @name respawn_phase |
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.
Wrong name
| tagProcessor.registerMechanism("first_dragon_killed", false, ElementTag.class, (object, mechanism, input) -> { | ||
| DragonBattle battle = object.getWorld().getEnderDragonBattle(); | ||
| if (battle == null) { | ||
| mechanism.echoError("Provided world is not an end world!"); | ||
| return; | ||
| } | ||
| battle.setPreviouslyKilled(input.asBoolean()); | ||
| }); |
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.
Needs Mechanism#requireBoolean
| // Set whether the first ender dragon was killed already. | ||
| // Only works in end worlds. |
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.
Might be nice to document exactly what this does - does it reset the end and respawn the dragon? is it just a value that doesn't really affect anything?
| // <--[tag] | ||
| // @attribute <WorldTag.healing_crystals> | ||
| // @returns ListTag(EntityTag) | ||
| // @description | ||
| // Returns a ListTag of the healing end crystals located on top of the obsidian towers. | ||
| // Only works if the world is an end world. | ||
| // --> |
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.
These tags are missing the Paper plugin requirement/group meta
| // @attribute <WorldTag.respawn_crystals> | ||
| // @returns ListTag(EntityTag) | ||
| // @description | ||
| // Returns a ListTag of the respawn crystals located at the end exit portal. |
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.
Nitpick, but I'd probably mention end crystals here (like in the WorldTag.healing_crystals meta)
| // <--[mechanism] | ||
| // @object WorldTag | ||
| // @name first_dragon_killed | ||
| // @input ElementTag(Boolean) | ||
| // @description | ||
| // Set whether the first ender dragon was killed already. | ||
| // Toggling this value won't really affect anything in the end world, but may be useful when creating custom end worlds. | ||
| // Only works if the world is an end world. | ||
| // --> |
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.
Should have a tag link to first_dragon_killed (and vice versa)
gateway_counthealing_crystalsrespawn_crystalsspawn_gatewayfirst_dragon_killedrespawn_dragonreset_crystalsrespawn_phasefirst_dragon_killedI opened this as a draft PR because I haven't tested any of this/just wrote this up, and want it open so that I don't lose it in my sea of local and published branches. Feel free to comment/review though!