Fabric API

Fabric API

106M Downloads

Add default block ContextPredicates

Linguardium opened this issue ยท 2 comments

commented

Currently some properties of BlockSettings require Context Predicates.
vanilla Blocks class has constants such as ::always and ::never to simplify this.

Ideally Fabric Api should add some defaults or builders for predicates to allow for suffocates(true) or suffocates(ContextPredicates::always), for instance. While it is easy to (a,b,c)->true/false, It would make sense to provide a common predicate for this rather than having everyone create their own for the same purpose.

FabricBlockSettings doesn't seem like the right place to define these though.

commented

I don't think this is particularly useful, and would risk making the block settings harder to read.

commented

For a lot of these cases, it may be possible to add some default builder methods in FabricBlockSettings that apply the always or never context predicates so users don't need to worry about calling it themselves