Degradation for Player & HumanEntity APIs#21
Open
Sqrilizz wants to merge 4 commits into
Open
Conversation
… defaults - PatchBukkitPlayer: all methods now return safe defaults (no-op void, false/0/null for getters, GameMode.SURVIVAL, etc.) - PatchBukkitHumanEntity: ~120 methods converted from throwing exceptions to safe defaults (health=20, food=20, eyeHeight=1.62, gameMode=SURVIVAL, Collections.empty() for collections, etc.) - PatchBukkitInventory: remove @OverRide from methods not in Paper API - PatchBukkitServer: add startup Java version check (requires 21+) - bridge.proto: add GetPlayerAddress RPC + java_multiple_files option for future Simple Voice Chat compatibility
Contributor
Author
|
i'll fix all of the issues |
…atches - proto/mod.rs: add patchbukkit::inventory module - native_callbacks/inventory.rs: stub impls for GetInventory, SetInventorySlot, and GetPlayerAddress (all gracefully return None/empty) - native_callbacks/mod.rs: register inventory module - events/handler.rs: add wildcard arm for PlayerQuit/PlayerChat - native_callbacks/events.rs: add wildcard => None arm for unhandled events
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
UnsupportedOperationExceptionmethods replaced with safe defaultsspigot()returns a defaultPlayer.SpigotinstanceisConversing,beginConversation, etc.) — no-op /false0for gettersserialize()returns{"name": playerName}getProtocolVersion()returns775getVirtualHost()/getHAProxyAddress()returnnullactiveBossBars()returns empty iterablegetPlayerProfile()delegates toBukkit.createProfile()performCommand()delegates toBukkit.dispatchCommand()ban()/banIp()overloads returnnullgetAddress()— FFI call to Rust backend viaNativeBridgeFfi.getPlayerAddress()with gracefulnullfallback (requires Rust impl)PatchBukkitHumanEntity(~120 methods)getHealth()=20.0,getMaxHealth()=20.0,getAbsorptionAmount()=0.0getFoodLevel()=20,getSaturation()=5.0,getExhaustion()=0.0getRemainingAir()/getMaximumAir()=300getEyeHeight()=1.62,getEyeLocation()= location + 1.62isGliding/Swimming/Sleeping/Climbing/Blocking()=false,hasAI()=truegetActivePotionEffects()returns empty,hasPotionEffect()=falsegetItemInHand()/setItemInHand()delegate toPlayerInventory, open* methods returnnullgetGameMode()=GameMode.SURVIVAL,getMainHand()=MainHand.RIGHTPatchBukkitServerRuntimeExceptionif JDK < 21 (fixes confusingNoSuchMethodErrorfrom j4rs on old JDKs, see [CRASH] Error occurred during initialization of VM #12PatchBukkitInventory@OverridefromisEmpty(int),getItem(NamespacedKey),setItem(NamespacedKey, ItemStack), andremoveItem(Predicate, int, ItemStack...)- these signatures are not present in the current Paper APIbridge.protojava_multiple_files = true+java_package = "patchbukkit.bridge"GetPlayerAddressRPC for future Simple Voice Chat plugin supportIssue References