Skip to content

Instantly share code, notes, and snippets.

@apple502j
Created April 14, 2022 03:12
Show Gist options
  • Save apple502j/9125af9e38023c77f20c3fb5fc0dfa1d to your computer and use it in GitHub Desktop.
Save apple502j/9125af9e38023c77f20c3fb5fc0dfa1d to your computer and use it in GitHub Desktop.

22w15a docs

Known Issues

No crashes or similar important bugs have been discovered.

Fixed Bugs

  • Crashes introduced in the previous version (Random multithreading issue and UUID issue) were fixed.
  • This release fixes the crash when beds in custom dimension. This issue was previously patched via Fabric API.

Changes

Random Stuff

22w14a introduced some changes to random number generation. Here is a reminder that AtomicSimpleRandom will crash when used concurrently - this also affected vanilla, when trying to play a sound. If you are somehow using world.random or similar AtomicSimpleRandom instances outside the client/server thread, including the network IO thread, you should switch to world.field_38861 (note that this requires accessor or access widener.)

Speaking of random changes, MobEntity#initEquipment and updateEnchantments now takes AbstractRandom argument. Same goes for HorseBaseEntity#initAttributes.

fastutil Usage Expanded

The code now uses fastutil collections in many places to improve performance, most notably LootTable#generateLoot. While they can be casted to regular List, Map, etc, it is not recommended. Check the fastutil javadoc for usage notes.

Datagen Changes

Code that previously took DataCache argument now requires class_7403 (an interface). The interface has two methods, the first one being the path for both. 43345 is for text contents and you pass the text. 43346 is for binary contents and you pass the content and its SHA1 hash.

You must now always call addProvider even if you do not use it. Whether to run the provider or not can be controlled via its first boolean argument. Fabric API adds addProvider(DataProvider) overload that always runs the provider.

Game Events

There were some changes to game events. Two new methods for emitting a game event - WorldAccess#method_43275 and method_43276 - were added. Some will take a new class, GameEvent.class_7397, as an argument. This is the "emitter" and holds the source entity or the affected block state.

Code renaming, moving etc

  • Entity#getLandingPos's functionality is moved to method_43260 and getLandingBlockState to method_43261. The previously existing methods (23312) are still there but they behave differently; 43260 checks (x, y-0.2, z) while 23312 now check at (x, y-1e-05, z). This means that for example if you are on a carpet on a soul soil 43260 returns the soul soil's position while 23312 returns the carpet's position. Things like soul speed check in vanilla use 43260 thus keeping the previous behavior, while the sculk sensor wool check now uses 23312 allowing carpets to cancel vibrations. The names will be fixed in the next yarn release.
  • PlayerEntity#getUuidFromProfile was moved to DynamicSerializableUuid#method_43343; same goes for getOfflinePlayerUuid.

Misc changes

  • level:// protocol support for server resource packs removed.
  • Resource pack downloading related code now uses URL.
  • Trying to read a null text from PacketByteBuf now raises DecoderException.

News

DFU Optimizations

DataFixerUpper (the library) now supports lazy optimization similar to LazyDFU; however the game does not use this feature. Mojang is also considering merging some changes from the DFU fork Cadmium by JellySquid.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment