Skip to content

Conversation

@heypr
Copy link
Contributor

@heypr heypr commented May 8, 2024

  • Requested by Josh65.
  • Adds 3 paper-only, 1.20+ tags:
    • gateway_count
    • healing_crystals
    • respawn_crystals
  • Adds 1 paper-only, 1.20+ mechanism:
    • spawn_gateway
  • Adds 1 regular tag:
    • first_dragon_killed
  • Adds 4 regular mechanisms;
    • respawn_dragon
    • reset_crystals
    • respawn_phase
    • first_dragon_killed

I 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!

@heypr heypr marked this pull request as ready for review June 26, 2024 13:36
if (!mechanism.hasValue()) {
battle.spawnNewGateway();
}
if (mechanism.requireObject(LocationTag.class)) {
Copy link
Member

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.");
Copy link
Member

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)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just ElementTag

mcmonkey4eva
mcmonkey4eva previously approved these changes Jul 5, 2024
// @returns ElementTag(Number)
// @description
// Returns the number of end gateway portals.
// Only works in end worlds.
Copy link
Member

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.
Copy link
Member

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>
Copy link
Member

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.
Copy link
Member

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));
Copy link
Member

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>
Copy link
Member

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?

Comment on lines 1068 to 1075
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));
});
Copy link
Member

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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wrong name

Comment on lines 1087 to 1094
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());
});
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs Mechanism#requireBoolean

Comment on lines 1084 to 1085
// Set whether the first ender dragon was killed already.
// Only works in end worlds.
Copy link
Member

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?

mcmonkey4eva
mcmonkey4eva previously approved these changes Oct 6, 2024
Comment on lines 50 to 56
// <--[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.
// -->
Copy link
Member

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.
Copy link
Member

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)

Comment on lines 1081 to 1089
// <--[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.
// -->
Copy link
Member

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)

@tal5 tal5 merged commit 6919884 into DenizenScript:dev Oct 17, 2024
1 check passed
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.

3 participants