Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Several minor cleanups/fixes #2580

Merged
merged 3 commits into from Dec 19, 2023
Merged

Conversation

tal5
Copy link
Member

@tal5 tal5 commented Dec 19, 2023

Changes

  • Makes WardenChangesAngerLevelScriptEvent's determination registration properly use registerOptionalDetermination to return false for invalid input.
  • Added a default implementation for BlockHelper#getMapColor using Spigot's new BlockData#getMapColor.
  • Removed EntityHelper#getEntity(World, UUID) in favor of Spigot's Bukkit#getEntity(UUID).
  • Added a default implementation for EntityHelper#getPlayersThatSee using Spigot's new Entity#getTrackedBy.
  • EntityTag#getEntityForID now uses Bukkit#getEntity.
  • Replaced redundant early return usage in EntityBoatType#setPropertyValue.
  • Removed the redundant attacker.getEquipment().getItemInMainHand() != null from EntityHelperImpl(1.20)#getDamageTo, as getItemInMainHand isn't nullable.
  • PlayerHelperImpl(1.20)#refreshPlayer now uses ServerPlayer#createCommonSpawnInfo instead of manually creating the spawn info.
  • BiomeNMSImpl(1.20)#getSpawnableEntities now uses the new CraftEntityType#minecraftToBukkit instead of the existing hacky conversion.
  • Moved the DisguisePacketHandlers to after the EntityMetadataPacketHandlers, to avoid stuff like the invisible command overriding disguised entity's visibility.
  • DisguisePacketHandlers#processTeleportPacket now uses DenizenNetworkManagerImpl#copyPacket instead of manually creating a new packet and copying values over (which also means relevant reflection constants were removed).
  • Removed some old commented out ClientboundAddPlayerPacket handling code.
  • Fixed PlayerTag.skin_model breaking on 1.17 because Spigot's player profile API didn't exist back then, and uses a MultiVersionHelper because Java doesn't like it when enums that don't exist are referenced.

Additions

  • MultiVersionHelper1_18 - used by PlayerTag.skin_model, because that API didn't exist before 1.18 and it has an enum.

@mcmonkey4eva mcmonkey4eva merged commit fba327b into DenizenScript:dev Dec 19, 2023
1 check passed
@tal5 tal5 deleted the Minor_Cleanups branch December 21, 2023 22:46
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.

None yet

2 participants