Add Composters as Farmer Workstations

This commit is contained in:
Frank 2022-07-29 13:21:01 +02:00
parent 0e8f9f6f8c
commit 47a744cf23
4 changed files with 18 additions and 9 deletions

View file

@ -45,6 +45,7 @@ public class PoiManager {
@ApiStatus.Internal
public static void registerAll() {
PoiManager.setTag(PoiTypes.FISHERMAN, CommonPoiTags.FISHERMAN_WORKSTATION);
PoiManager.setTag(PoiTypes.FARMER, CommonPoiTags.FARMER_WORKSTATION);
}

View file

@ -7,6 +7,7 @@ import org.betterx.bclib.complexmaterials.entry.RecipeEntry;
import org.betterx.bclib.recipes.GridRecipe;
import org.betterx.worlds.together.tag.v3.CommonBlockTags;
import org.betterx.worlds.together.tag.v3.CommonItemTags;
import org.betterx.worlds.together.tag.v3.CommonPoiTags;
import org.betterx.worlds.together.tag.v3.TagManager;
import net.minecraft.resources.ResourceLocation;
@ -216,22 +217,24 @@ public class WoodenComplexMaterial extends ComplexMaterial {
final protected void initDecorations(FabricBlockSettings blockSettings, FabricItemSettings itemSettings) {
addBlockEntry(new BlockEntry(
BLOCK_CRAFTING_TABLE,
(complexMaterial, settings) -> new BaseCraftingTableBlock(getBlock(BLOCK_PLANKS))
)
.setBlockTags(CommonBlockTags.WORKBENCHES)
.setItemTags(CommonItemTags.WORKBENCHES));
BLOCK_CRAFTING_TABLE,
(cmx, settings) -> new BaseCraftingTableBlock(getBlock(BLOCK_PLANKS))
)
.setBlockTags(CommonBlockTags.WORKBENCHES)
.setItemTags(CommonItemTags.WORKBENCHES)
);
addBlockEntry(new BlockEntry(
BLOCK_BOOKSHELF,
(complexMaterial, settings) -> new BaseBookshelfBlock(getBlock(BLOCK_PLANKS))
(cmx, settings) -> new BaseBookshelfBlock(getBlock(BLOCK_PLANKS))
)
.setBlockTags(CommonBlockTags.BOOKSHELVES));
addBlockEntry(new BlockEntry(
BLOCK_COMPOSTER,
(complexMaterial, settings) -> new BaseComposterBlock(getBlock(BLOCK_PLANKS))
));
)
.setBlockTags(CommonPoiTags.FARMER_WORKSTATION));
}
@Override

View file

@ -34,12 +34,14 @@ public class BlockEntry extends ComplexMaterialEntry {
this.hasItem = hasItem;
}
public BlockEntry setBlockTags(TagKey<Block>... blockTags) {
@SafeVarargs
public final BlockEntry setBlockTags(TagKey<Block>... blockTags) {
this.blockTags = blockTags;
return this;
}
public BlockEntry setItemTags(TagKey<Item>... itemTags) {
@SafeVarargs
public final BlockEntry setItemTags(TagKey<Item>... itemTags) {
this.itemTags = itemTags;
return this;
}

View file

@ -2,11 +2,14 @@ package org.betterx.worlds.together.tag.v3;
import net.minecraft.tags.TagKey;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.Blocks;
public class CommonPoiTags {
public static final TagKey<Block> FISHERMAN_WORKSTATION = TagManager.BLOCKS.makeCommonTag("workstation/fisherman");
public static final TagKey<Block> FARMER_WORKSTATION = TagManager.BLOCKS.makeCommonTag("workstation/farmer");
static {
TagManager.BLOCKS.addOtherTags(FISHERMAN_WORKSTATION, CommonBlockTags.BARREL, CommonBlockTags.WOODEN_BARREL);
TagManager.BLOCKS.add(FARMER_WORKSTATION, Blocks.COMPOSTER);
}
}