3C #4
Omena0
announced in
Announcements
3C
#4
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
3C
Plugging some old holes in the API. Full codebase cleanup. New extensions.
Changes
New Extensions
%placeholder%expansions with per-player context and batchresolve_many()@every()/@after()decorators and cancellationon_enter/on_exit/on_tickcallbacks and event-driven transitionsNew APIs
@preservedecorator: hot-reload state persistence — caches return value to JSON and restores across/pjb reloadfire_event(event_name, data)— scripts can fire and listen to custom events across scriptsVillager.recipes(get/set),recipe_count,add_recipe(),clear_recipes()velocity,fire_ticks,custom_name,gravity,glowing,invisible,invulnerable,silent,persistent,collidable,bounding_box,metadatagoal_types,remove_goal(),remove_all_goals()hidePlayer/showPlayer/canSee,openBook,sendBlockChange,sendParticle, cooldown management, statistics,getMaxHealth/setMaxHealth, bed spawn, compass target, PersistentDataContainer accessgetDrops,getHardness,getBlastResistance, PersistentDataContainer for tile entitiesisUnbreakable/setUnbreakablegetHighestBlockAt,generateTree,getNearbyEntities,batchSpawn, structure API (save/load/delete/list),createWorld/deleteWorldEntity.__bool__()viaisValid()Refactoring & Code Quality
str.removeprefix()modernization replacingstartswith()+ sliceserver.playersde-awaited in guild, leaderboard, npc, region (was incorrectlyawaited)@preserveevent handlers fixed: lambdas replaced with proper async def functions-Xlint:deprecationOptimizations — Java
getDrops→List.copyOf(),clearRecipes→List.of()List.of()return for null modifiersgetCachedMethod(), pre-sized lists indispatchBlockMulti()Optimizations — Python
_ENUM_TYPE_MAPPINGmoved to module-level constant (was recreated on every enum deserialization)_JSON_SEPARATORS,_RESERVED_KWARGSfrozenset,_MINECRAFT_PREFIXEStuple: module-level constantsevent_batchhandler inlined: avoids temp dict creation and full re-dispatch per payload"x" in dinstead offrozenset.issubset(d.keys())import math/import loggingmoved to module-level__slots__added to 27 classes across helpers and extensionstransfer()to avoid double_save()add_xp,xp_to_next/progressavoid redundant bridge callremaining_cooldownto avoid doubletime.time()+ double dict lookup.get()lookup instead ofin+[]_toml_write_table(): single-pass scalar/sub-table separationBug Fixes
server.playersincorrectly awaited in guild, leaderboard, npc, region@preserveevent handler signature (lambda → async def)setLoreNPE when argument is not a list (added else branch withList.of())Documentation & Tooling
This discussion was created from the release 3C.
Beta Was this translation helpful? Give feedback.
All reactions