Skip to content

Conversation

@EpicPlayerA10
Copy link
Contributor

@EpicPlayerA10 EpicPlayerA10 commented May 29, 2024

Changes

  • Added required adapters for 1.20.6 due to internals breaking changes
  • Restructured a bit PlayerHeadAdapters
  • Added paper-specific adapters too. This change will make dough future-proof on paper.
  • Added exclusions in pom.xml in module dough-protection because dough couldn't be compiled. This is because one of dependencies provided very old version of bukkit which broke compilation
  • In main pom.xml changed from spigot to paper to be able to use paper features in adapters

@EpicPlayerA10
Copy link
Contributor Author

ItemUtils.damageItem needs an update as well, the unbreaking enchantment enum name is renamed.

We don't need to do this as from what i see dough is not updating minecraft version in the pom.xml:

dough/pom.xml

Lines 287 to 292 in baf2d79

<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.18.1-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>

And spigot already auto renames these fields for plugins that are built for older minecraft versions: https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/browse/src/main/java/org/bukkit/craftbukkit/legacy/FieldRename.java . So no error will be thrown.

@mcchampions
Copy link

This pr conflicts with #219.

@md5sha256
Copy link
Contributor

ItemUtils.damageItem needs an update as well, the unbreaking enchantment enum name is renamed.

We don't need to do this as from what i see dough is not updating minecraft version in the pom.xml:

dough/pom.xml

Lines 287 to 292 in baf2d79

<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.18.1-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>

And spigot already auto renames these fields for plugins that are built for older minecraft versions: https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/browse/src/main/java/org/bukkit/craftbukkit/legacy/FieldRename.java . So no error will be thrown.

This does need to be updated as otherwise dough cannot compile if the consumer is compiling against 1.20.5+. The suggested fix is to refactor it to use the bukkit Registry.ENCHANTMENT api and grab it via the minecraft namespaced key.

@EpicPlayerA10
Copy link
Contributor Author

Done

Property property = profile.getProperties().get("textures").iterator().next();

PlayerProfile paperPlayerProfile = Bukkit.createProfile(profile.getId(), profile.getName());
paperPlayerProfile.setProperty(new ProfileProperty(property.name(), property.value(), property.signature()));
Copy link

@mcchampions mcchampions Aug 12, 2024

Choose a reason for hiding this comment

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

Java started using records in Java 16, while Authlib didn't use records until much later. As of the last version of Paper 1.18.2 that depended on Authlib, Property was still a class. Therefore, you might need to use reflection to call the getter method of an older version of Property.

Copy link
Contributor

@ybw0014 ybw0014 left a comment

Choose a reason for hiding this comment

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

Based on the result server testing by boomer:

The adapter is using adventure which was not bundled into Paper until 1.19.4
so to support it, we can only use this version or higher.
@WalshyDev WalshyDev merged commit f8ff251 into Slimefun:main Sep 9, 2024
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.

7 participants