-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix : issue with CustomCraft hidden enchantment
- Loading branch information
1 parent
4f0dd1e
commit c5c654d
Showing
23 changed files
with
646 additions
and
23 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
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
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
7 changes: 5 additions & 2 deletions
7
nms/interfaces/src/main/java/fr/fabienhebuterne/customcraft/nms/ItemStackSerializer.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 |
---|---|---|
@@ -1,8 +1,11 @@ | ||
package fr.fabienhebuterne.customcraft.nms; | ||
|
||
import org.bukkit.enchantments.Enchantment; | ||
import org.bukkit.inventory.ItemStack; | ||
|
||
public interface ItemStackSerializer { | ||
public String serializeItemStack(ItemStack itemStack); | ||
public ItemStack deserializeItemStack(String itemStack); | ||
String serializeItemStack(ItemStack itemStack); | ||
ItemStack deserializeItemStack(String itemStack); | ||
void loadCustomCraftEnchantment(); | ||
Enchantment getCustomCraftEnchantment(); | ||
} |
52 changes: 52 additions & 0 deletions
52
nms/v1_18_R2/src/main/java/fr/fabienhebuterne/customcraft/nms/CustomCraftEnchantment.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,52 @@ | ||
package fr.fabienhebuterne.customcraft.nms; | ||
|
||
import org.bukkit.NamespacedKey; | ||
import org.bukkit.enchantments.Enchantment; | ||
import org.bukkit.enchantments.EnchantmentTarget; | ||
import org.bukkit.inventory.ItemStack; | ||
|
||
public class CustomCraftEnchantment extends Enchantment { | ||
public CustomCraftEnchantment(NamespacedKey key) { | ||
super(key); | ||
} | ||
|
||
@Override | ||
public String getName() { | ||
return getKey().getKey(); | ||
} | ||
|
||
@Override | ||
public int getMaxLevel() { | ||
return 1; | ||
} | ||
|
||
@Override | ||
public int getStartLevel() { | ||
return 1; | ||
} | ||
|
||
@Override | ||
public EnchantmentTarget getItemTarget() { | ||
return EnchantmentTarget.ALL; | ||
} | ||
|
||
@Override | ||
public boolean isTreasure() { | ||
return false; | ||
} | ||
|
||
@Override | ||
public boolean isCursed() { | ||
return false; | ||
} | ||
|
||
@Override | ||
public boolean conflictsWith(Enchantment other) { | ||
return false; | ||
} | ||
|
||
@Override | ||
public boolean canEnchantItem(ItemStack item) { | ||
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
52 changes: 52 additions & 0 deletions
52
nms/v1_19_R1/src/main/java/fr/fabienhebuterne/customcraft/nms/CustomCraftEnchantment.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,52 @@ | ||
package fr.fabienhebuterne.customcraft.nms; | ||
|
||
import org.bukkit.NamespacedKey; | ||
import org.bukkit.enchantments.Enchantment; | ||
import org.bukkit.enchantments.EnchantmentTarget; | ||
import org.bukkit.inventory.ItemStack; | ||
|
||
public class CustomCraftEnchantment extends Enchantment { | ||
public CustomCraftEnchantment(NamespacedKey key) { | ||
super(key); | ||
} | ||
|
||
@Override | ||
public String getName() { | ||
return getKey().getKey(); | ||
} | ||
|
||
@Override | ||
public int getMaxLevel() { | ||
return 1; | ||
} | ||
|
||
@Override | ||
public int getStartLevel() { | ||
return 1; | ||
} | ||
|
||
@Override | ||
public EnchantmentTarget getItemTarget() { | ||
return EnchantmentTarget.ALL; | ||
} | ||
|
||
@Override | ||
public boolean isTreasure() { | ||
return false; | ||
} | ||
|
||
@Override | ||
public boolean isCursed() { | ||
return false; | ||
} | ||
|
||
@Override | ||
public boolean conflictsWith(Enchantment other) { | ||
return false; | ||
} | ||
|
||
@Override | ||
public boolean canEnchantItem(ItemStack item) { | ||
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
Oops, something went wrong.