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 @ApiStatus.Internal
public static void registerAll() { public static void registerAll() {
PoiManager.setTag(PoiTypes.FISHERMAN, CommonPoiTags.FISHERMAN_WORKSTATION); 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.bclib.recipes.GridRecipe;
import org.betterx.worlds.together.tag.v3.CommonBlockTags; import org.betterx.worlds.together.tag.v3.CommonBlockTags;
import org.betterx.worlds.together.tag.v3.CommonItemTags; 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 org.betterx.worlds.together.tag.v3.TagManager;
import net.minecraft.resources.ResourceLocation; import net.minecraft.resources.ResourceLocation;
@ -216,22 +217,24 @@ public class WoodenComplexMaterial extends ComplexMaterial {
final protected void initDecorations(FabricBlockSettings blockSettings, FabricItemSettings itemSettings) { final protected void initDecorations(FabricBlockSettings blockSettings, FabricItemSettings itemSettings) {
addBlockEntry(new BlockEntry( addBlockEntry(new BlockEntry(
BLOCK_CRAFTING_TABLE, BLOCK_CRAFTING_TABLE,
(complexMaterial, settings) -> new BaseCraftingTableBlock(getBlock(BLOCK_PLANKS)) (cmx, settings) -> new BaseCraftingTableBlock(getBlock(BLOCK_PLANKS))
) )
.setBlockTags(CommonBlockTags.WORKBENCHES) .setBlockTags(CommonBlockTags.WORKBENCHES)
.setItemTags(CommonItemTags.WORKBENCHES)); .setItemTags(CommonItemTags.WORKBENCHES)
);
addBlockEntry(new BlockEntry( addBlockEntry(new BlockEntry(
BLOCK_BOOKSHELF, BLOCK_BOOKSHELF,
(complexMaterial, settings) -> new BaseBookshelfBlock(getBlock(BLOCK_PLANKS)) (cmx, settings) -> new BaseBookshelfBlock(getBlock(BLOCK_PLANKS))
) )
.setBlockTags(CommonBlockTags.BOOKSHELVES)); .setBlockTags(CommonBlockTags.BOOKSHELVES));
addBlockEntry(new BlockEntry( addBlockEntry(new BlockEntry(
BLOCK_COMPOSTER, BLOCK_COMPOSTER,
(complexMaterial, settings) -> new BaseComposterBlock(getBlock(BLOCK_PLANKS)) (complexMaterial, settings) -> new BaseComposterBlock(getBlock(BLOCK_PLANKS))
)); )
.setBlockTags(CommonPoiTags.FARMER_WORKSTATION));
} }
@Override @Override

View file

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

View file

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