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_TICK
event. TickManager
can be obtained fromMinecraftServer#getTickManager
orWorld#getTickManager
(works withClientWorld
as well).- Use
shouldSkipTick
for checking if an entity should be ticked. (beware, it is the inverse ofshouldTick
.) - 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.
Here are some block changes:
TransparentBlock
was split intoTranslucentBlock
, which renders in a translucent way (like slime and ice blocks), andTransparentBlock
, which extendsTranslucentBlock
and is used by grates and glass blocks.AbstractGlassBlock
andGlassBlock
were removed.Blocks#createStairs
was renamed tocreateStairsBlock
, andcreateBambooBlock
is nowcreateLogBlock
.BambooSaplingBlock
was renamed toBambooShootBlock
.JigsawOrientation
was renamed toOrientation
.LootableContainerBlockEntity
logics were split intoLootableInventory
.checkLootInteraction
was renamed togenerateLoot
.LootableContainerBlockEntity
still implementsLootableInventory
, but this allows other block entities like decorated pots to share the logic.
- Almost all bits of code taking
File
are now replaced withPath
. CheckboxWidget
is now built using a builder.Util#shuffle
now accepts anyList
.Box(BlockPos, BlockPos)
constructor is now a static method namedenclosing
.PersistentProjectileEntity
and its subclasses now take theItemStack
in the constructor, representing the item stack form that players can pick up.getItemStack
returns the stack as-is, whileasItemStack
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 toremoveCommandTag
.ServerCommandSource#withResultStorer
was changed towithReturnValueConsumer
, with some changes to the argument it takes.