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

Housekeeping: remove unneeded legacy version checks & clean up code. #6676

Draft
wants to merge 6 commits into
base: dev/feature
Choose a base branch
from

Conversation

Moderocky
Copy link
Member

Description

This is the batch merge request for #6641.

It removes checks for methods existing that are standard as of 1.13.2, since we no longer support versions below this.

What can be removed?

Version checks for 1.13 and lower. Method & class existence checks that were standard as of Spigot for 1.13.2. Paper-only checks are still required for a few things that didn't arrive in Spigot until later (or at all).

See the linked issue #6641 for more details.

If you want to contribute to this project, open a pull request targeting remove-legacy-code and it will be included in this pull request.

What next?

Another clean-up can be done before 2.10 for things under 1.17.
This will include a few bits and pieces that couldn't be fully cleaned up in this PR.

This is a branch merge request!

Individual pull requests were made by contributors to its feature branch: this can be merged as-is to preserve the Git change history.


Target Minecraft Versions: any
Requirements: none
Related Issues: #6641

* Remove deprecated visibility method use.

* Remove support checks from block change.

* Fix mistake in SendTitle (and remove 1.13 warnings).

* Remove check from make fly.
@Moderocky Moderocky added documentation Related to Skript's official documentation. 2.9 Targeting a 2.9.X version release help wanted Contributions are highly welcomed housekeeping Housekeeping-related issue or task. labels May 9, 2024
if (Skript.methodExists(Player.class, "hasResourcePack"))
register(CondHasResourcePack.class, PropertyType.HAVE, "[a] resource pack [(loaded|installed)]", "players");
register(CondHasResourcePack.class, PropertyType.HAVE, "[a] resource pack [(loaded|installed)]", "players");

Choose a reason for hiding this comment

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

Doesn't this still require the check? I can't see the Player#hasResourcePack() in Spigot 1.13.2.

Copy link
Contributor

Choose a reason for hiding this comment

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

Based on the fact @RequiredPlugins state "Paper 1.9 or newer" it is possible. As such I did go and check latest spigot releases and there's no method for hasResourcePack so this check should still remain

Copy link
Member

Choose a reason for hiding this comment

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

yes this was only on the list for documentation update

Comment on lines -45 to +48
if (Skript.methodExists(Creeper.class, "isIgnited")) {
Skript.registerCondition(CondIgnitionProcess.class,
"[creeper[s]] %livingentities% ((is|are)|1¦(isn't|is not|aren't|are not)) going to explode",
"[creeper[s]] %livingentities% ((is|are)|1¦(isn't|is not|aren't|are not)) in the (ignition|explosion) process",
"creeper[s] %livingentities% ((is|are)|1¦(isn't|is not|aren't|are not)) ignited");
}
Skript.registerCondition(CondIgnitionProcess.class,
"[creeper[s]] %livingentities% ((is|are)|1¦(isn't|is not|aren't|are not)) going to explode",
"[creeper[s]] %livingentities% ((is|are)|1¦(isn't|is not|aren't|are not)) in the (ignition|explosion) process",
"creeper[s] %livingentities% ((is|are)|1¦(isn't|is not|aren't|are not)) ignited");

Choose a reason for hiding this comment

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

This as well.

cheeezburga and others added 2 commits May 13, 2024 10:12
Removed some redundant existing checks and some other changes
- Happy to revert other changes (changes that aren't only the existing checks) if they're out of the scope of this PR (6676)
cheeezburga and others added 2 commits May 29, 2024 15:54
* Removed some redundant exists checks and made formatting more consistent in SimpleEvents

* Removed unused imports

* Put back the potiondata method handles

---

Co-authored-by: Moderocky <[email protected]>
…ses (#6693)

* Removed PassengerUtils class and replaced methods in referencing classes

* Apply suggestions from code review

* Formatting stuff

---------

Co-authored-by: Moderocky <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.9 Targeting a 2.9.X version release documentation Related to Skript's official documentation. help wanted Contributions are highly welcomed housekeeping Housekeeping-related issue or task.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants