Skip to content

Commit

Permalink
Fix MC 1.20.5/6 result, change native version to 1.20.6
Browse files Browse the repository at this point in the history
  • Loading branch information
demengc committed May 25, 2024
1 parent f053f42 commit 76a29f6
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

package dev.demeng.pluginbase.item;

import com.cryptomorin.xseries.XEnchantment;
import com.cryptomorin.xseries.XMaterial;
import com.mojang.authlib.GameProfile;
import com.mojang.authlib.properties.Property;
Expand Down Expand Up @@ -325,13 +326,17 @@ public ItemBuilder clearFlags() {
*/
public ItemBuilder glow(final boolean glow) {

if (glow) {
enchant(Enchantment.DURABILITY, 1);
flags(ItemFlag.HIDE_ENCHANTS);
final Enchantment enchant = XEnchantment.UNBREAKING.getEnchant();

} else {
stack.removeEnchantment(Enchantment.DURABILITY);
updateMeta(meta -> meta.removeItemFlags(ItemFlag.HIDE_ENCHANTS));
if (enchant != null) {
if (glow) {
enchant(XEnchantment.UNBREAKING.getEnchant(), 1);
flags(ItemFlag.HIDE_ENCHANTS);

} else {
stack.removeEnchantment(XEnchantment.UNBREAKING.getEnchant());
updateMeta(meta -> meta.removeItemFlags(ItemFlag.HIDE_ENCHANTS));
}
}

return this;
Expand Down
6 changes: 4 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>3.2.1</version>
<executions>
<execution>
<id>attach-sources</id>
Expand All @@ -72,6 +73,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.3.2</version>
<configuration>
<doclint>none</doclint>
</configuration>
Expand Down Expand Up @@ -131,7 +133,7 @@
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.16.4-R0.1-SNAPSHOT</version>
<version>1.20.6-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
Expand All @@ -143,7 +145,7 @@
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.30</version>
<version>1.18.32</version>
<scope>provided</scope>
</dependency>
</dependencies>
Expand Down

0 comments on commit 76a29f6

Please sign in to comment.