FAPI needs transitive AW for PointOfInterestType
frqnny opened this issue · 6 comments
I could but why would I? I am sorry but I still don’t get the impl difference. I am asking for a TAW not for the constructor but for the register methods in it.
Ahhh hmmm right. Usually we don't expose these static register methods in Fabric API. It's also annoying that they only take String
and not Identifier
... I think that would be an easy mistake to make.
Why not use PointOfInterestHelper
? Making methods in PointOfInterestType
directly accessible is a bit error-prone due to the required setup
call.
We already call setup with (look at what i highlighted with **)
https://github.com/FabricMC/fabric/blob/1.18.2/fabric-object-builder-api-v1/src/main/java/net/fabricmc/fabric/mixin/object/builder/PointOfInterestTypeAccessor.java
private static PointOfInterestType register(Identifier id, int ticketCount, int searchDistance, Set<BlockState> states) {
return Registry.register(Registry.POINT_OF_INTEREST_TYPE, id, PointOfInterestTypeAccessor.**callSetup**(
PointOfInterestTypeAccessor.callCreate(id.toString(), states, ticketCount, searchDistance)));
}
private static PointOfInterestType register(Identifier id, int ticketCount, Predicate<PointOfInterestType> typePredicate, int searchDistance, Set<BlockState> states) {
return Registry.register(Registry.POINT_OF_INTEREST_TYPE, id, PointOfInterestTypeAccessor.**callSetup**(
PointOfInterestTypeAccessor.callCreate(id.toString(), states, ticketCount, typePredicate, searchDistance)));
}
`
Yes but why don't you use PointOfInterestHelper? It's too easy to forget about the setup call for this to be a TAW, imo.