Skip to content

Instantly share code, notes, and snippets.

@apple502j
Created April 9, 2023 01:59
Show Gist options
  • Save apple502j/9fa61efbf2c4f489e12c4eb14cbe4f7b to your computer and use it in GitHub Desktop.
Save apple502j/9fa61efbf2c4f489e12c4eb14cbe4f7b to your computer and use it in GitHub Desktop.

23w14a stuff

I'm sick rn.

Fabric Changes

Fabric API 0.77.1 contains yet another Object Builder breaking changes, to FabricMaterialBuilder and BlockSetTypeRegistry. A crash in Loot API was fixed in 0.77.2.

Unrelated to snapshots, but: last week, Fabric Networking API received a big update. Check https://gist.github.com/apple502j/9c6b9e5e8dec37cbf6f3916472a79d57 for more info.

Minecraft Changes

Material Reducer (and other blocky news)

Material is confirmed to be removed at some point in the near future, to be replaced with block settings. This snapshot brought changes to further reduce use of Material. Namely, the Material#isLiquid is moved to BlockState#isLiquid, and several materials were removed. The current materials are:

  • PLANT
  • AGGREGATE
  • WOOD
  • STONE
  • GLASS
  • ALLOWS_MOVEMENT_LIGHT_PASSES_THROUGH_NOT_SOLID_REPLACEABLE
  • ALLOWS_MOVEMENT_LIGHT_PASSES_THROUGH_NOT_SOLID
  • ALLOWS_MOVEMENT
  • LIGHT_PASSES_THROUGH
  • COBWEB
  • NOT_SOLID_ALLOWS_MOVEMENT
  • GENERIC

Material-based block checks should now use tags or instanceof.

Other block related changes:

  • BlockSetType now has canOpenByHand field, and BlockSetTypeRegistry now takes this parameter.
  • DoorBlock#isWoodenDoor methods were renamed to canOpenByHand.
  • Block#canMobSpawnInside now takes one parameter, state.
  • New interface Crop is used to mark a crop that is plantable on a farmland. CropBlock implements this interface, so you don't have to implement yourself in most cases.

ItemStack changes

Code modifying ItemStack should now use the combined methods (such as copyWithCount) instead of 2 method calls (such as copy + setCount) to properly handle empty stacks. ItemStack#copyAndEmpty was added to move the contents of one stack into a new copy.

Loot changes

Predicates and item modifiers (or, in legacy terms, loot conditions and loot functions) are now managed by LootManager. They are identified using LootDataKey, similar to RegistryKey. getTable is renamed to getLootTable, and getElement can be used to get loot tables, predicates, or item modifiers.

Additions

  • IceBlock#getMeltedState to return the ice's melted state, which can be frosted using Frost Walker (i.e. water).
  • KeyCodes#isToggle to check if a key code is used for toggling input.
  • Entity#getNameLabelHeight to return the offset for name label.
  • JsonDataLoader#load to load JSON data using Gson deserialization.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment