🔄 livereload#
Reloads the world on each build, through beet link or the configured datapack destinations.
- get_local_datapack_destinations(
- ctx: Context,
Return the resolved local datapack destinations from
meta.stewbeet.build_copy_destinations.datapack.- Parameters:
ctx – The beet context.
- Returns:
Resolved absolute paths of local datapack destination folders (may be empty).
- Return type:
list[str]
- get_sftp_datapack_destinations(
- ctx: Context,
Return the remote
sftp://datapack destinations frommeta.stewbeet.build_copy_destinations.datapack.- Parameters:
ctx – The beet context.
- Returns:
sftp://datapack destination URLs (may be empty).- Return type:
list[str]
- get_local_resource_pack_destinations(
- ctx: Context,
Return the resolved local resource pack destinations from
meta.stewbeet.build_copy_destinations.resource_pack.- Parameters:
ctx – The beet context.
- Returns:
Resolved absolute paths of local resource pack destination folders (may be empty).
- Return type:
list[str]
- find_minecraft_dir(
- ctx: Context,
- data_pack_dir: Path | None = None,
- link_minecraft: str | None = None,
Locate the client Minecraft directory holding
logs/latest.log, None if it cannot be determined.Live reload tails that log’s
[CHAT]lines to remove the polling datapack after each/reload, so it is the client.minecrafteven when the datapack is deployed to a separate local orsftpserver.- Resolution order:
Explicit override
meta.stewbeet.livereload.minecraft(directory containinglogs/)The
beet linkMinecraft directory (if the project is also linked)Walking up from each local resource pack destination (the client
.minecraft, where[CHAT]is logged)Walking up from the local datapack destination (singleplayer worlds stored under
.minecraft/saves)
- Parameters:
data_pack_dir – A local datapack destination folder, if any.
link_minecraft – The Minecraft directory from
beet link, if any.
- patch_livereload_for_copy_destinations(
- ctx: Context,
Monkey-patch
beet.contrib.livereloadso live reloading also targets the folders listed inmeta.stewbeet.build_copy_destinations.datapack(local and remotesftp://), in addition to the usualbeet linkfolder.This lets users get automatic in-game
/reloadwith nothing more than their existingbuild_copy_destinationsconfiguration (nobeet linkrequired). All methods coexist: a linked folder, local copy destinations and remotesftp://destinations all get reloaded together.The patch is idempotent (safe to call several times, e.g. from both
stewbeet.plugins.initializeandstewbeet.plugins.livereload) and is a no-op if livereload isn’t installed or no datapack destination is configured.- Parameters:
ctx – The beet context.
- livereload_with_copy_destinations(
- ctx: Context,
Replacement for
beet.contrib.livereload.livereloadsupporting local and SFTP copy destinations.
- beet_default(
- ctx: Context,
Live reload wrapper plugin for StewBeet.
Triggers an in-game
/reloadafter every build, one-shot or watched, through thebeet linkfolder and/or the StewBeetbuild_copy_destinations.datapackfolders (local and remotesftp://). The polling datapack left by the previous build is removed first, so that the game sees it appear again and reloads. Simply require this plugin (or add it to the pipeline) instead of wiring upbeet.contrib.livereloadandbeet linkmanually.- Parameters:
ctx – The beet context.