Skip to content

PlayerRaiseLowerItemScriptEvent Update#2825

Open
MC-Samuel wants to merge 2 commits intoDenizenScript:devfrom
MC-Samuel:lunge-event
Open

PlayerRaiseLowerItemScriptEvent Update#2825
MC-Samuel wants to merge 2 commits intoDenizenScript:devfrom
MC-Samuel:lunge-event

Conversation

@MC-Samuel
Copy link
Copy Markdown
Contributor

Adds "spears" to the list of acceptable raisableItems for 1.21+
Requested at https://discord.com/channels/315163488085475337/1460101419490349159

Comment on lines +56 to +60
public static final EnumSet<Material> raisableItems = EnumSet.of(Material.SHIELD, Material.CROSSBOW, Material.BOW, Material.TRIDENT, Material.SPYGLASS);
public static final EnumSet<Material> raisableItems = NMSHandler.getVersion().isAtLeast(NMSVersion.v1_21) ?
EnumSet.of(Material.SHIELD, Material.CROSSBOW, Material.BOW, Material.TRIDENT, Material.SPYGLASS, Material.COPPER_SPEAR, Material.DIAMOND_SPEAR, Material.GOLDEN_SPEAR, Material.IRON_SPEAR, Material.NETHERITE_SPEAR, Material.STONE_SPEAR, Material.WOODEN_SPEAR)
: EnumSet.of(Material.SHIELD, Material.CROSSBOW, Material.BOW, Material.TRIDENT, Material.SPYGLASS);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is kinda messy imo - I'd have non-version-limited stuff inline, and then have an additional static {} block with a version check to add on extra stuff.
Can also use Tag.SPEARS instead of listing them manually.

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.

2 participants