Yarn: "does this have that tag" methods have very different names

Created on 15 Dec 2019  路  8Comments  路  Source: FabricMC/yarn

As of Yarn 1.15+build.1, Item#isIn, Fluid#matches, EntityType#isTaggedWith, and Block#matches all have pretty much the same implementation - return tag.contains(this) - but have very different names. These all basically do the same thing so they should be unified to have the same name.

bug

All 8 comments

I support isIn.

Additionnally, the method for entities should not be called isTaggedWith, as it seems it returns what the Tags nbt contains, instead of datapack tags

I like matches personally

it would have been tag.matches(item) than item.matches(tag)

item.within(tag)
item.has(tag)
item.taggedWith(tag)

within can be just is in, being in a tag isn't an intrinsic property of an item so has is inaccurate, and taggedWith is too long and isn't intrinsic either

I think isIn is the more accurate one

Was this page helpful?
0 / 5 - 0 ratings