Skip to content

Degradation for Player & HumanEntity APIs#21

Open
Sqrilizz wants to merge 4 commits into
Pumpkin-MC:masterfrom
Sqrilizz:master
Open

Degradation for Player & HumanEntity APIs#21
Sqrilizz wants to merge 4 commits into
Pumpkin-MC:masterfrom
Sqrilizz:master

Conversation

@Sqrilizz
Copy link
Copy Markdown
Contributor

Changes

  • All remaining UnsupportedOperationException methods replaced with safe defaults
  • spigot() returns a default Player.Spigot instance
  • Conversation API (isConversing, beginConversation, etc.) — no-op / false
  • Statistics API - no-op setters, 0 for getters
  • serialize() returns {"name": playerName}
  • getProtocolVersion() returns 775
  • getVirtualHost() / getHAProxyAddress() return null
  • activeBossBars() returns empty iterable
  • getPlayerProfile() delegates to Bukkit.createProfile()
  • performCommand() delegates to Bukkit.dispatchCommand()
  • ban() / banIp() overloads return null
  • getAddress() — FFI call to Rust backend via NativeBridgeFfi.getPlayerAddress() with graceful null fallback (requires Rust impl)

PatchBukkitHumanEntity (~120 methods)

  • Health: getHealth() = 20.0, getMaxHealth() = 20.0, getAbsorptionAmount() = 0.0
  • Food: getFoodLevel() = 20, getSaturation() = 5.0, getExhaustion() = 0.0
  • Air: getRemainingAir() / getMaximumAir() = 300
  • Eye height: getEyeHeight() = 1.62, getEyeLocation() = location + 1.62
  • Combat: isGliding/Swimming/Sleeping/Climbing/Blocking() = false, hasAI() = true
  • Potion effects: setters no-op, getActivePotionEffects() returns empty, hasPotionEffect() = false
  • Inventory: getItemInHand() / setItemInHand() delegate to PlayerInventory, open* methods return null
  • getGameMode() = GameMode.SURVIVAL, getMainHand() = MainHand.RIGHT
  • Movement, combat, projectile, equipment, sleeping, recipes — all safe defaults

PatchBukkitServer

PatchBukkitInventory

  • Removed @Override from isEmpty(int), getItem(NamespacedKey), setItem(NamespacedKey, ItemStack), and removeItem(Predicate, int, ItemStack...) - these signatures are not present in the current Paper API

bridge.proto

  • Added java_multiple_files = true + java_package = "patchbukkit.bridge"
  • Added GetPlayerAddress RPC for future Simple Voice Chat plugin support

Issue References

  • Closes #12 (clear error message for old JDK users)

… 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
@Sqrilizz
Copy link
Copy Markdown
Contributor Author

i'll fix all of the issues

Sqrilizz added 3 commits May 23, 2026 00:07
…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
@Sqrilizz Sqrilizz changed the title Graceful Degradation for Player & HumanEntity APIs Degradation for Player & HumanEntity APIs May 22, 2026
@Sqrilizz Sqrilizz changed the title Degradation for Player & HumanEntity APIs Plz work ig May 22, 2026
@Sqrilizz Sqrilizz changed the title Plz work ig Degradation for Player & HumanEntity APIs May 22, 2026
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.

[CRASH] Error occurred during initialization of VM

1 participant