Skip to content

Choose a tag to compare

@Omena0 Omena0 released this 11 Mar 08:44
· 10 commits to main since this release
Immutable release. Only release title and notes can be modified.

3D

Performance overhaul — fire-and-forget calls, msgpack wire protocol, field cache invalidation, and reduced serialization payload.

Changes

Fire-and-Forget Calls

  • Added call_fire_forget() to BridgeConnection — sends calls with no_response: true, skipping Future creation and await
  • Added _call_ff() to ProxyBase — convenience wrapper for fire-and-forget bridge calls
  • Java handleCall() checks no_response flag and skips result serialization + response sending
  • Java executeBatchCalls() supports no_response per-call in both atomic and non-atomic batch paths
  • Converted ~80+ void/setter methods on Entity and Player to fire-and-forget:
    • Entity: teleport, remove, velocity setter, fire_ticks setter, add_passenger/remove_passenger, custom_name setter, gravity/glowing/invisible/invulnerable/silent/persistent/collidable setters, portal_cooldown/freeze_ticks setters, eject, leave_vehicle, set_rotation
    • Entity (Mob): target setter, is_aware setter, stop_pathfinding, remove_all_goals
    • Player: damage, send_message, chat, kick, give_exp, add_effect/remove_effect, set_game_mode, set_scoreboard, set_op, play_sound, send_action_bar, send_title, tab list setters, health/food/level/exp setters, flying/sneaking/sprinting setters, walk/fly speed setters, send_resource_pack, absorption/saturation/exhaustion setters, allow_flight setter, hide_player/show_player, open_book, send_block_change, send_particle, set_cooldown, set_statistic, max_health setter, bed_spawn_location/compass_target setters, set_persistent_data

Field Cache Invalidation

  • Added _invalidate_field() to ProxyBase — removes cached field values so next access fetches fresh data from Java
  • Setters that modify cached values call _invalidate_field() before sending the fire-and-forget call, preventing desync:
    • teleport → invalidates location, world
    • give_exp → invalidates exp, level
    • set_game_mode → invalidates gameMode, game_mode
    • set_health → invalidates health
    • set_food_level → invalidates foodLevel, food_level
    • level setter → invalidates level
    • exp setter → invalidates exp
    • max_health setter → invalidates health

Reduced Serialization Payload

  • Removed inventory from Player auto-serialization in BridgeSerializer — inventory is now fetched on demand instead of included in every Player object

Msgpack Wire Protocol

  • Python: 3-tier serialization import chain — msgpack → orjson → stdlib json
  • Python: handshake message sent as JSON on connect to negotiate format with Java
  • Java: handleHandshake() switches useMsgpack flag on format negotiation
  • Java: serializePayload()/deserializePayload() helper methods convert JsonObject ↔ msgpack at IPC boundaries
  • Java: full msgpack ↔ Gson JsonElement tree conversion (unpackValue, packJsonElement) handling all types (nil, bool, int, float, string, binary, array, map)
  • Java: bridgeLoop(), send(), sendAll(), sendWithTiming() all route through format-aware helpers
  • Build: added com.gradleup.shadow plugin, org.msgpack:msgpack-core:0.9.8 shaded and relocated to com.pyjavabridge.libs.msgpack
  • copyPluginJar and copyReleaseJar tasks updated to depend on shadowJar

Bug Fixes

  • Fixed stray return self._call_sync(method) in _invalidate_field that would have crashed on every call