Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed enchantments in 1.16 extending EnchantmentWrapper causing errors
- Loading branch information
1 parent
cab4383
commit 845708d
Showing
6 changed files
with
111 additions
and
88 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
group 'v1_16_R3' | ||
|
||
dependencies { | ||
compileOnly "org.spigotmc:v1_16_R3:latest" | ||
compileOnly project(":API") | ||
compileOnly parent | ||
} | ||
|
||
if (project.hasProperty('nms.compile_v1_16') && !Boolean.valueOf(project.findProperty("nms.compile_v1_16").toString())) { | ||
project.tasks.all { task -> task.enabled = false } | ||
} |
51 changes: 51 additions & 0 deletions
51
...n/java/com/bgsoftware/superiorskyblock/nms/v1_16_R3/algorithms/SpigotGlowEnchantment.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
package com.bgsoftware.superiorskyblock.nms.v1_16_R3.algorithms; | ||
|
||
import org.bukkit.NamespacedKey; | ||
import org.bukkit.enchantments.Enchantment; | ||
import org.bukkit.enchantments.EnchantmentTarget; | ||
|
||
public class SpigotGlowEnchantment extends Enchantment { | ||
|
||
public SpigotGlowEnchantment(String name) { | ||
super(NamespacedKey.minecraft(name)); | ||
} | ||
|
||
@Override | ||
public String getName() { | ||
return "SuperiorSkyblockGlow"; | ||
} | ||
|
||
@Override | ||
public int getMaxLevel() { | ||
return 1; | ||
} | ||
|
||
@Override | ||
public int getStartLevel() { | ||
return 0; | ||
} | ||
|
||
@Override | ||
public EnchantmentTarget getItemTarget() { | ||
return null; | ||
} | ||
|
||
public boolean isTreasure() { | ||
return false; | ||
} | ||
|
||
public boolean isCursed() { | ||
return false; | ||
} | ||
|
||
@Override | ||
public boolean conflictsWith(Enchantment enchantment) { | ||
return false; | ||
} | ||
|
||
@Override | ||
public boolean canEnchantItem(org.bukkit.inventory.ItemStack itemStack) { | ||
return true; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
...in/java/com/bgsoftware/superiorskyblock/nms/v1_16_R3/algorithms/PaperGlowEnchantment.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
package com.bgsoftware.superiorskyblock.nms.v1_16_R3.algorithms; | ||
|
||
import io.papermc.paper.enchantments.EnchantmentRarity; | ||
import net.kyori.adventure.text.Component; | ||
import org.bukkit.entity.EntityCategory; | ||
import org.bukkit.inventory.EquipmentSlot; | ||
|
||
import java.util.HashSet; | ||
import java.util.Set; | ||
|
||
public final class PaperGlowEnchantment extends SpigotGlowEnchantment { | ||
|
||
public PaperGlowEnchantment(String name) { | ||
super(name); | ||
} | ||
|
||
@Override | ||
public Component displayName(int i) { | ||
return Component.empty(); | ||
} | ||
|
||
@Override | ||
public boolean isTradeable() { | ||
return false; | ||
} | ||
|
||
@Override | ||
public boolean isDiscoverable() { | ||
return false; | ||
} | ||
|
||
@Override | ||
public EnchantmentRarity getRarity() { | ||
return EnchantmentRarity.COMMON; | ||
} | ||
|
||
@Override | ||
public float getDamageIncrease(int i, EntityCategory entityCategory) { | ||
return 0; | ||
} | ||
|
||
@Override | ||
public Set<EquipmentSlot> getActiveSlots() { | ||
return new HashSet<>(); | ||
} | ||
|
||
} |