It's been almost a year since the first "Snapshot Note" series! Anyway here's the 23w03a stuff info.
Fabric Loader 0.14.13 should be used for this version.
Fabric API 0.72.1 is released for this version. Biome API received 1 breaking change; setPrecipitation
method in BiomeModificationContext.WeatherContext
now takes a boolean.
Multiple S2C packets can now be bundled into a single packet, so that they are processed in the same client tick. The bundled packets are still sent separately, but is re-bundled in the client.
Example of bundling 2 CustomPayloadS2CPacket
and 1 GameMessageS2CPacket
:
List<Packet<ClientPlayPacketListener>> packets = List.of(
ServerPlayNetworking.createS2CPacket(id, buf),
ServerPlayNetworking.createS2CPacket(id2, buf2),
new GameMessageS2CPacket(Text.of("Test"), false)
);
player.sendPacket(new BundleS2CPacket(packets));
On the client, the handlers are invoked for each packet in the same order.
Internally, an encoder on the Netty side splits the bundled packet and inserts BundleSplitterPacket
, a marker packet. The client reassembles the packets and processes all at once after the last one is received. This is now used to send entity tracker updates.
Gegy is improving the performance of DataFixerUpper, but that PR hasn't been merged yet. That said, this snapshot contains some data fixer changes, possibly related to the improvement:
update
methods inNbtHelper
are moved toDataFixTypes
.- There is now a method to update
Dynamic
s that aren't NBT. getDataVersion
andputDataVersion
methods were added toNbtHelper
.
TranslatableTextContent
now supports text fallbacks. To construct texts with fallbacks, use Text#translatableWithFallback
. ScreenTexts
received CONTINUE
and SPACE
predefined texts, as well as space
method for chaining like space().append(text)
.
Similarly, Language#get
now allows fallback to be passed.
Biome precipitation is now a boolean. Whether it rains or snows is now entirely dependent on temperature and is positional; if the temperature is below 0.15
, it snows. Biome Modification API's setPrecipitation
method now takes a boolean to reflect this, and Biome#getPrecipitation
and hasPrecipitation
methods were added to reflect this. Biome#isHot
is removed and replaced with tags for specific usecases.
Biome JSON files should now have a boolean has_precipitation
field, not enum precipitation
field.
RenderSystem#enableTexture
and disableTexture
has been removed. They are no longer necessary. It is also no longer necessary to call setShaderColor
before setShaderTexture
.
GUI code has received changes to support new keyboard navigation. After each keyboard navigation, the game recalculates the focused element; it creates a tree of elements, making sure only one element is focused at a time. Screen
implementations should call setInitialFocus
within the init
method.
Several MathHelper
methods unused or easily replaceable with java.lang.Math
methods were removed. They are: fastFloor
, average
, packRgb
, fastInverseSqrt
, lerpAngle
, fwrapDegrees
, the long
and byte
overload of clamp
, multiplyColors
, murmurHash
, parseDouble
, parseInt
, getCumulativeDistribution
, absFloor
, magnitude
, and ceil
.
lerpAngle
can be replaced with lerpAngleDegrees
. Note the argument order; lerpAngle(a, b, c)
's equivalent is lerpAngleDegrees(c, a, b)
.
DamageTiltS2CPacket
that tilts the screen of the players that took damage.BlockPosArgumentType#getLoadedBlockPos
that grabs the block pos argument if the position is loaded.Advancement#getRoot
for getting the root advancement.GameVersion
received several methods, previously defined in JavaBridge.TimeArgumentType#time
withminimum
parameter for setting the minimum value.Codecs#string
for a codec of length-validated string.LogoDrawer
for drawing the Minceraft (or Minecraft) logo.
PlayerPositionLookS2CPacket.Flag
is now a separate class namedPositionFlag
.Packet
is moved tonet.minecraft.network.packet
.BlockPosArgumentType#getBlockPos
is renamed togetValidBlockPos
.
- JavaBridge is removed from dependencies.
PacketListener#getConnection
is removed.ResourceType#getPackVersion
is replaced withGameVersion#getPackVersion
.World#hasHighHumidity
is removed.Entity#canUsePortals
now checks for vehicles.TestContext#useOnBlock
now invokesItem#useOnBlock
ifBlock#use
fails.