Added Behaviours for all relevant Blocks

This commit is contained in:
Frank 2023-05-23 19:47:00 +02:00
parent 3b2a2d4294
commit 6cb70dd35f
83 changed files with 1317 additions and 395 deletions

View file

@ -9,6 +9,7 @@ public class CommonBlockTags {
public static final TagKey<Block> BARREL = TagManager.BLOCKS.makeCommonTag("barrel");
public static final TagKey<Block> BOOKSHELVES = TagManager.BLOCKS.makeCommonTag("bookshelves");
public static final TagKey<Block> CHEST = TagManager.BLOCKS.makeCommonTag("chest");
public static final TagKey<Block> COMPOSTER = TagManager.BLOCKS.makeCommonTag("composter");
public static final TagKey<Block> END_STONES = TagManager.BLOCKS.makeCommonTag("end_stones");
public static final TagKey<Block> GEN_END_STONES = END_STONES;
public static final TagKey<Block> IMMOBILE = TagManager.BLOCKS.makeCommonTag("immobile");
@ -26,6 +27,7 @@ public class CommonBlockTags {
public static final TagKey<Block> SCULK_LIKE = TagManager.BLOCKS.makeCommonTag("sculk_like");
public static final TagKey<Block> WOODEN_BARREL = TagManager.BLOCKS.makeCommonTag("wooden_barrels");
public static final TagKey<Block> WOODEN_CHEST = TagManager.BLOCKS.makeCommonTag("wooden_chests");
public static final TagKey<Block> WOODEN_COMPOSTER = TagManager.BLOCKS.makeCommonTag("wooden_composter");
public static final TagKey<Block> WORKBENCHES = TagManager.BLOCKS.makeCommonTag("workbench");
public static final TagKey<Block> DRAGON_IMMUNE = TagManager.BLOCKS.makeCommonTag("dragon_immune");
@ -115,5 +117,13 @@ public class CommonBlockTags {
CommonBlockTags.NETHER_STONES,
CommonBlockTags.NETHERRACK
);
TagManager.BLOCKS.addOtherTags(
BlockTags.MINEABLE_WITH_AXE,
WOODEN_BARREL,
WOODEN_COMPOSTER,
WOODEN_CHEST,
WORKBENCHES
);
}
}

View file

@ -78,6 +78,10 @@ public class TagRegistry<T> {
public final void add(T element, TagKey<T>... tagIDs) {
super.add(element, tagIDs);
}
public final boolean contains(TagKey<T> tagID, T element) {
return super.contains(tagID, element);
}
}
public static class Biomes extends Simple<Biome> {
@ -254,6 +258,19 @@ public class TagRegistry<T> {
}
}
protected boolean contains(TagKey<T> tagID, T element) {
final Set<TagEntry> set = getSetForTag(tagID);
final ResourceLocation id = locationProvider.apply(element);
if (id != null) {
for (var entry : set)
if (!entry.elementOrTag().tag()) {
if (id.equals(entry.elementOrTag().id()))
return true;
}
}
return false;
}
protected void add(T element, TagKey<T>... tagIDs) {
for (TagKey<T> tagID : tagIDs) {
add(tagID, element);