The sort-of-weekly thingy is back?
No breaking changes for Fabric API.
/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 yourSTART_WORLD_TICK/END_WORLD_TICK/START_SERVER_TICK/END_SERVER_TICKevent. TickManagercan be obtained fromMinecraftServer#getTickManagerorWorld#getTickManager(works withClientWorldas well).- Use
shouldSkipTickfor checking if an entity should be ticked. (beware, it is the inverse ofshouldTick.) - Note: You do not need to call these checks inside
Entity/BlockEntitytick 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.
Here are some block changes:
TransparentBlockwas split intoTranslucentBlock, which renders in a translucent way (like slime and ice blocks), andTransparentBlock, which extendsTranslucentBlockand is used by grates and glass blocks.AbstractGlassBlockandGlassBlockwere removed.Blocks#createStairswas renamed tocreateStairsBlock, andcreateBambooBlockis nowcreateLogBlock.BambooSaplingBlockwas renamed toBambooShootBlock.JigsawOrientationwas renamed toOrientation.LootableContainerBlockEntitylogics were split intoLootableInventory.checkLootInteractionwas renamed togenerateLoot.LootableContainerBlockEntitystill implementsLootableInventory, but this allows other block entities like decorated pots to share the logic.
- Almost all bits of code taking
Fileare now replaced withPath. CheckboxWidgetis now built using a builder.Util#shufflenow accepts anyList.Box(BlockPos, BlockPos)constructor is now a static method namedenclosing.PersistentProjectileEntityand its subclasses now take theItemStackin the constructor, representing the item stack form that players can pick up.getItemStackreturns the stack as-is, whileasItemStackreturns a copy (potentially reflecting the changes like potion override).- Added
Entity#getPlayerPassengerswhich returns the number of passengers that are players. Entity#removeScoreboardTagwas renamed toremoveCommandTag.ServerCommandSource#withResultStorerwas changed towithReturnValueConsumer, with some changes to the argument it takes.