fabric icon indicating copy to clipboard operation
fabric copied to clipboard

[Request]: Widen Access of StrippableBlockRegistry `getRegistry`

Open fzzyhmstrs opened this issue 2 years ago • 1 comments
trafficstars

Issue: Modders that want to implement a non-axe item that can strip logs like an axe (say a sword that also has a saw blade or something).... have no easy access to the strippable log registry the AxeItem uses. Currently the FAPI registry only allows for modders to add new block pairs, but doesn't help with access.

Concern: This has led some modders to utilize the AxeItemAccessor to grab this information, despite marked as internal, because it exists. This causes a hard incompatibility with QFAPI (which doesn't have this accessor), besides the normal potential concerns with using internals. At the very least modders are currently forced to duplicate the accessor, which seems wasteful compared to an already existing method being widened for use.

Solution: Widen the method getRegistry() to public to provide access to users that want a custom non-axe item with stripping capabilities.

fzzyhmstrs avatar Jun 06 '23 01:06 fzzyhmstrs

Alternate possible solution: An API helper method getStrippedState that mirrors the one in AxeItem and provides the Optional<BlockState> that the AxeItem uses without needing to expose the registry.

image

fzzyhmstrs avatar Jun 06 '23 01:06 fzzyhmstrs

Already implemented: https://github.com/FabricMC/fabric/blob/1.21.10/fabric-content-registries-v0/src/main/java/net/fabricmc/fabric/api/registry/StrippableBlockRegistry.java

maityyy avatar Nov 03 '25 12:11 maityyy