Skip to content

Instantly share code, notes, and snippets.

@apple502j
Created November 3, 2023 04:29
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save apple502j/67769440c14838e0fba0d26fe24064fa to your computer and use it in GitHub Desktop.
Save apple502j/67769440c14838e0fba0d26fe24064fa to your computer and use it in GitHub Desktop.

23w44a (and some bits of 43a)

The sort-of-weekly thingy is back?

Fabric update

No breaking changes for Fabric API.

Minecraft update

Ticks (23w43a)

/tick command from the Carpet mod arrives in the vanilla game. To support this functionality in your mod:

  • Note, this change affects both the server and the client.
  • Use getTickManager().shouldTick() to check if things should tick in your START_WORLD_TICK/END_WORLD_TICK/START_SERVER_TICK/END_SERVER_TICK event.
  • TickManager can be obtained from MinecraftServer#getTickManager or World#getTickManager (works with ClientWorld as well).
  • Use shouldSkipTick for checking if an entity should be ticked. (beware, it is the inverse of shouldTick.)
  • Note: You do not need to call these checks inside Entity/BlockEntity tick methods or events. Only call inside server/world tick events.

It is also now possible that the game can run faster or slower than 50MSPT intentionally (as opposed to lags). Call TickManager#getMillisPerTick() to determine the intended MSPT.

Blocks

Here are some block changes:

  • TransparentBlock was split into TranslucentBlock, which renders in a translucent way (like slime and ice blocks), and TransparentBlock, which extends TranslucentBlock and is used by grates and glass blocks. AbstractGlassBlock and GlassBlock were removed.
  • Blocks#createStairs was renamed to createStairsBlock, and createBambooBlock is now createLogBlock.
  • BambooSaplingBlock was renamed to BambooShootBlock.
  • JigsawOrientation was renamed to Orientation.
  • LootableContainerBlockEntity logics were split into LootableInventory. checkLootInteraction was renamed to generateLoot. LootableContainerBlockEntity still implements LootableInventory, but this allows other block entities like decorated pots to share the logic.

Misc changes

  • Almost all bits of code taking File are now replaced with Path.
  • CheckboxWidget is now built using a builder.
  • Util#shuffle now accepts any List.
  • Box(BlockPos, BlockPos) constructor is now a static method named enclosing.
  • PersistentProjectileEntity and its subclasses now take the ItemStack in the constructor, representing the item stack form that players can pick up. getItemStack returns the stack as-is, while asItemStack returns a copy (potentially reflecting the changes like potion override).
  • Added Entity#getPlayerPassengers which returns the number of passengers that are players.
  • Entity#removeScoreboardTag was renamed to removeCommandTag.
  • ServerCommandSource#withResultStorer was changed to withReturnValueConsumer, with some changes to the argument it takes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment