-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
176 additions
and
90 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
89 changes: 86 additions & 3 deletions
89
minestom/src/com/elikill58/negativity/minestom/impl/item/MinestomEnchants.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,10 +1,93 @@ | ||
package com.elikill58.negativity.minestom.impl.item; | ||
|
||
import com.elikill58.negativity.api.item.Enchantment; | ||
import org.jetbrains.annotations.NotNull; | ||
|
||
import net.minestom.server.item.enchant.Enchantment; | ||
import net.minestom.server.registry.DynamicRegistry; | ||
|
||
public class MinestomEnchants { | ||
|
||
public static net.minestom.server.item.enchant.Enchantment getEnchant(Enchantment enchant) { | ||
return net.minestom.server.item.enchant.Enchantment.fromNamespaceId(enchant.getId()); | ||
public static @NotNull DynamicRegistry.Key<Enchantment> getEnchant(com.elikill58.negativity.api.item.Enchantment enchant) { | ||
switch (enchant) { | ||
case AQUA_AFFINITY: | ||
return Enchantment.AQUA_AFFINITY; | ||
case BANE_OF_ARTHROPODS: | ||
return Enchantment.BANE_OF_ARTHROPODS; | ||
case BINDING_CURSE: | ||
return Enchantment.BINDING_CURSE; | ||
case BLAST_PROTECTION: | ||
return Enchantment.BLAST_PROTECTION; | ||
case CHANNELING: | ||
return Enchantment.CHANNELING; | ||
case DEPTH_STRIDER: | ||
return Enchantment.DEPTH_STRIDER; | ||
case EFFICIENCY: | ||
return Enchantment.EFFICIENCY; | ||
case FEATHER_FALLING: | ||
return Enchantment.FEATHER_FALLING; | ||
case FIRE_ASPECT: | ||
return Enchantment.FIRE_ASPECT; | ||
case FIRE_PROTECTION: | ||
return Enchantment.FIRE_PROTECTION; | ||
case FLAME: | ||
return Enchantment.FLAME; | ||
case FORTUNE: | ||
return Enchantment.FORTUNE; | ||
case FROST_WALKER: | ||
return Enchantment.FROST_WALKER; | ||
case IMPALING: | ||
return Enchantment.IMPALING; | ||
case INFINITY: | ||
return Enchantment.INFINITY; | ||
case KNOCKBACK: | ||
return Enchantment.KNOCKBACK; | ||
case LOOTING: | ||
return Enchantment.LOOTING; | ||
case LOYALTY: | ||
return Enchantment.LOYALTY; | ||
case LUCK_OF_THE_SEA: | ||
return Enchantment.LUCK_OF_THE_SEA; | ||
case LURE: | ||
return Enchantment.LURE; | ||
case MENDING: | ||
return Enchantment.MENDING; | ||
case MULTISHOT: | ||
return Enchantment.MULTISHOT; | ||
case PIERCING: | ||
return Enchantment.PIERCING; | ||
case POWER: | ||
return Enchantment.POWER; | ||
case PROJECTILE_PROTECTION: | ||
return Enchantment.PROJECTILE_PROTECTION; | ||
case PROTECTION: | ||
return Enchantment.PROTECTION; | ||
case PUNCH: | ||
return Enchantment.PUNCH; | ||
case QUICK_CHARGE: | ||
return Enchantment.QUICK_CHARGE; | ||
case RESPIRATION: | ||
return Enchantment.RESPIRATION; | ||
case RIPTIDE: | ||
return Enchantment.RIPTIDE; | ||
case SHARPNESS: | ||
return Enchantment.SHARPNESS; | ||
case SILK_TOUCH: | ||
return Enchantment.SILK_TOUCH; | ||
case SMITE: | ||
return Enchantment.SMITE; | ||
case SOUL_SPEED: | ||
return Enchantment.SOUL_SPEED; | ||
case SWEEPING: | ||
return Enchantment.SWEEPING_EDGE; | ||
case SWIFT_SNEAK: | ||
return Enchantment.SWIFT_SNEAK; | ||
case THORNS: | ||
return Enchantment.THORNS; | ||
case UNBREAKING: | ||
return Enchantment.UNBREAKING; | ||
case VANISHING_CURSE: | ||
return Enchantment.VANISHING_CURSE; | ||
} | ||
return null; | ||
} | ||
} |
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