Skip to content

Instantly share code, notes, and snippets.

@apple502j
Last active November 18, 2022 12:06
Show Gist options
  • Save apple502j/1bc2dd67fe7e055d9be5d00fa0c04fbe to your computer and use it in GitHub Desktop.
Save apple502j/1bc2dd67fe7e055d9be5d00fa0c04fbe to your computer and use it in GitHub Desktop.

22w46a Change Logs as usual

This one's a boring update.

Fabric API

Yet another week of breaking change. First, a new Fabric API version for the previous snapshot made one change to Datagen API: FabricWorldgenProvider is renamed to FabricDynamicRegistryProvider. This also added FabricItemGroupEntries#shouldShowOpRestrictedItems method and fixed various bugs within the Item Group API and Biome API.

This week, Fabric API 0.66.3 has one more breaking change: Textures API is now gone, as it was superseded with vanilla Atlas Configuration in resource packs. (The other feature, sprite dependency, was removed in 22w42a due to code breakage and lack of usage.)

Changes

Great Registry Repackaging

If you are using Mojang Mapping, you can probably ignore this. But please use Yarn, I spend hours on this boring fun "staring-at-mojank party" every week.*

TL;DR: Run a Find & Replace:

  • net.minecraft.tag to net.minecraft.registry.tag
  • net.minecraft.util.dynamic.RegistryOps to net.minecraft.registry.RegistryOps
  • net.minecraft.util.registry.RegistryEntry to net.minecraft.registry.entry.RegistryEntry
  • net.minecraft.util.registry to net.minecraft.registry

Yarn just got a Great Registry Repackaging, a proposal from February 11th by haykam (see issue #3002). After the 1.18.2 refactor made a tag part of the registry ecosystem, there was a discussion on having a registry a top-level package (like tags did). We chose this version, as the last snapshot's Registry content split meant most mods have to fix their imports anyway. (Note, we do not recommend updating mods to snapshots.)

The new package net.minecraft.registry replaces the net.minecraft.util.registry package, except that the RegistryEntry and related classes are now moved to the subpackage entry. RegistryOps is now also in the registry package. The whole net.minecraft.tag package has now moved to net.minecraft.registry.tag.

Textures API

As mentioned above, Fabric Textures API is now gone. This API, previously full of legacy junk, received its first set of breaking changes in 22w42a to adapt to the new sprites changes. Mojang's additional refactors to sprite loading made the API obsolete, as the same functionality can now be achieved by the vanilla resource pack. See the vanilla changelog for details.

Shader Renames

The confusing Shader/Program classes were renamed; see #3384.

New additions

  • Instrument#fromAboveState and fromBelowState, which gets the instrument for heads and other blocks. (Yes, Piglin is an instrument.)
  • OneTwentyAdvancementProviders and OneTwentyHusbandryTabAdvancementGenerator, which generates the 1.20 advancement JSONs.
  • FillBiomeCommand, which implements the new /fillbiome command.
  • ThreadedAnvilChunkStorage#sendChunkPacketToWatchingPlayers, which sends a chunk update packet (used by /fillbiome).
  • BlockBox#contains overload with three integer coordinates.
  • ItemStackSet#create, which creates a new set.
  • NativeImage#copyRect overload.
  • BlockEntry#getIdentifierPredicate, getPathPredicate, and getNamespacePredicate, which return the predicate of the resource blocking entry.
  • MinecraftClient#isConnectedToLocalServer, which checks whether the player has joined the integrated server.
  • MinecraftClient#isOptionalTelemetryEnabledByApi, isTelemetryEnabledByApi, and isOptionalTelemetryEnabled, which return various telemetry status.
  • MinecraftClient#getCurrentFps and getRenderTime, which are used inside telemetry records.
  • GameOptions#getTelemetryOptInExtra, which returns the option for opt-in part of telemetry.
  • LogFileCompressor, which provides rotated log file with Codec-based data serialization and automated Gzip compression.
  • LogReader and LogWriter, which reads from or writes to a log file.
  • GameMenuScreen#disconnect, which disconnects from the server or exits the singleplayer game.
  • OptionsScreen#createButton, which creates a button widget on the options screen.
  • MoreOptionsDialog#toString, which stringifies an OptionalLong.
  • GridWidget.Adder, which adds grid elements left to right, top to bottom, with the given max width.
  • SimpleOption#ofBoolean overload with value text getter parameter.
  • SimpleOption#createButton overload with the change callback parameter.
  • ClientWorld#putClientsideMapState, which is called in place of putMapState on the client.
  • EntitySelector#getAppendLimit, which returns the limit of results appended to the intermediary list.
  • ServerWorld#collectEntitiesByType and World#collectEntitiesByType, which collects entities, optionally with a limit for performance enhancement.
  • ServerWorld#getPlayers overload with limit parameter.
  • LookupContinuityGetter, which is a functional interface to check whether to keep iterating over entity lists.
  • TestContext#useBlock overload, which allows custom BlockHitResult to be passed.
  • TestContext#useStackOnBlock, which can test Item#onUse method.
  • Util#getResult, which unwraps DataResult and throws exceptions if the result is an error.
  • Uuids#STRING_CODEC, which is a codec for UUID serialized as its string representation.

Changes

  • Bundled Gson is now version 2.10. This added serialization of records. (However, I recommend Codec or another proper config library. Exposing the internal structure of a config class in a save data is generally not a good idea.)
  • TelemetrySender is repackaged to net.minecraft.client.util.telemetry (Welcome back!) and is renamed to TelemetryManager.
  • ButtonWidget builder methods are renamed to be more builder-y.
  • World generation related RegistryKeys are now consistently named.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment