-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ea43104
commit a8c8703
Showing
4 changed files
with
193 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
77 changes: 77 additions & 0 deletions
77
src/main/java/knightminer/inspirations/common/datagen/InspirationsBlockTagsProvider.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
package knightminer.inspirations.common.datagen; | ||
|
||
import knightminer.inspirations.building.InspirationsBuilding; | ||
import knightminer.inspirations.library.InspirationsTags; | ||
import knightminer.inspirations.tweaks.InspirationsTweaks; | ||
import knightminer.inspirations.utility.InspirationsUtility; | ||
import net.minecraft.block.Blocks; | ||
import net.minecraft.data.BlockTagsProvider; | ||
import net.minecraft.data.DataGenerator; | ||
import net.minecraft.tags.BlockTags; | ||
|
||
import javax.annotation.Nonnull; | ||
|
||
public class InspirationsBlockTagsProvider extends BlockTagsProvider { | ||
public InspirationsBlockTagsProvider(DataGenerator gen) { | ||
super(gen); | ||
} | ||
|
||
@Nonnull | ||
@Override | ||
public String getName() { | ||
return "Inspirations Block Tags"; | ||
} | ||
|
||
@Override | ||
protected void registerTags() { | ||
registerInspTags(); | ||
registerVanillaTags(); | ||
} | ||
|
||
private void registerInspTags() { | ||
this.getBuilder(InspirationsTags.Blocks.MULCH) | ||
.add(InspirationsBuilding.plainMulch) | ||
.add(InspirationsBuilding.blackMulch) | ||
.add(InspirationsBuilding.blueMulch) | ||
.add(InspirationsBuilding.brownMulch) | ||
.add(InspirationsBuilding.redMulch); | ||
|
||
this.getBuilder(InspirationsTags.Blocks.SMALL_FLOWERS) | ||
.add(InspirationsBuilding.flower_rose) | ||
.add(InspirationsBuilding.flower_cyan) | ||
.add(InspirationsBuilding.flower_paeonia) | ||
.add(InspirationsBuilding.flower_syringa); | ||
|
||
this.getBuilder(InspirationsTags.Blocks.ENLIGHTENED_BUSHES) | ||
.add(InspirationsBuilding.whiteEnlightenedBush) | ||
.add(InspirationsBuilding.blueEnlightenedBush) | ||
.add(InspirationsBuilding.greenEnlightenedBush) | ||
.add(InspirationsBuilding.redEnlightenedBush); | ||
|
||
this.getBuilder(InspirationsTags.Blocks.CARPETED_TRAPDOORS) | ||
.add(InspirationsUtility.carpetedTrapdoors); | ||
this.getBuilder(InspirationsTags.Blocks.CARPETED_PRESSURE_PLATES) | ||
.add(InspirationsUtility.carpetedPressurePlates); | ||
|
||
this.getBuilder(InspirationsTags.Blocks.BOOKSHELVES) | ||
.add(InspirationsBuilding.shelf_normal) | ||
.add(InspirationsBuilding.shelf_ancient) | ||
.add(InspirationsBuilding.shelf_rainbow) | ||
.add(InspirationsBuilding.shelf_tomes); | ||
|
||
this.getBuilder(InspirationsTags.Blocks.CAULDRON_FIRE) | ||
.add(Blocks.FIRE); | ||
} | ||
|
||
private void registerVanillaTags() { | ||
this.getBuilder(BlockTags.LEAVES).add(InspirationsTags.Blocks.ENLIGHTENED_BUSHES); | ||
this.getBuilder(BlockTags.DIRT_LIKE).add(InspirationsTags.Blocks.MULCH); | ||
this.getBuilder(BlockTags.BAMBOO_PLANTABLE_ON).add(InspirationsTags.Blocks.MULCH); | ||
this.getBuilder(BlockTags.WOODEN_TRAPDOORS).add(InspirationsTags.Blocks.CARPETED_TRAPDOORS); | ||
|
||
this.getBuilder(BlockTags.CARPETS) | ||
.add(InspirationsTweaks.fitCarpets) | ||
.add(InspirationsTags.Blocks.CARPETED_TRAPDOORS); | ||
|
||
} | ||
} |
79 changes: 79 additions & 0 deletions
79
src/main/java/knightminer/inspirations/common/datagen/InspirationsItemTagsProvider.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
package knightminer.inspirations.common.datagen; | ||
|
||
import knightminer.inspirations.Inspirations; | ||
import knightminer.inspirations.building.InspirationsBuilding; | ||
import knightminer.inspirations.library.InspirationsTags; | ||
import knightminer.inspirations.recipes.InspirationsRecipes; | ||
import knightminer.inspirations.tools.InspirationsTools; | ||
import net.minecraft.data.DataGenerator; | ||
import net.minecraft.data.ItemTagsProvider; | ||
import net.minecraft.item.DyeColor; | ||
import net.minecraft.item.Item; | ||
import net.minecraft.item.Items; | ||
import net.minecraft.tags.BlockTags; | ||
import net.minecraft.tags.ItemTags; | ||
import net.minecraft.tags.Tag; | ||
import net.minecraft.util.ResourceLocation; | ||
import net.minecraftforge.common.Tags; | ||
|
||
import javax.annotation.Nonnull; | ||
|
||
public class InspirationsItemTagsProvider extends ItemTagsProvider { | ||
public InspirationsItemTagsProvider(DataGenerator gen) { | ||
super(gen); | ||
} | ||
|
||
@Nonnull | ||
@Override | ||
public String getName() { | ||
return "Inspirations Item Tags"; | ||
} | ||
|
||
@Override | ||
protected void registerTags() { | ||
registerInspTags(); | ||
registerForgeTags(); | ||
registerVanillaTags(); | ||
} | ||
|
||
private void registerInspTags() { | ||
this.copy(InspirationsTags.Blocks.MULCH, InspirationsTags.Items.MULCH); | ||
this.copy(InspirationsTags.Blocks.SMALL_FLOWERS, InspirationsTags.Items.SMALL_FLOWERS); | ||
this.copy(InspirationsTags.Blocks.CARPETED_TRAPDOORS, InspirationsTags.Items.CARPETED_TRAPDOORS); | ||
this.copy(InspirationsTags.Blocks.BOOKSHELVES, InspirationsTags.Items.BOOKSHELVES); | ||
this.copy(InspirationsTags.Blocks.ENLIGHTENED_BUSHES, InspirationsTags.Items.ENLIGHTENED_BUSHES); | ||
|
||
this.getBuilder(InspirationsTags.Items.BOOKS) | ||
.add(InspirationsBuilding.coloredBooks) | ||
.add(InspirationsBuilding.redstoneBook) | ||
.add(Items.BOOK,Items.WRITABLE_BOOK, Items.WRITTEN_BOOK) | ||
.add(Items.ENCHANTED_BOOK, Items.KNOWLEDGE_BOOK) | ||
; | ||
|
||
// Copy the item form for us to use. | ||
this.copy(BlockTags.CARPETS, InspirationsTags.Items.CARPETS); | ||
|
||
this.getBuilder(InspirationsTags.Items.WAYPOINT_COMPASSES).add(InspirationsTools.waypointCompasses); | ||
|
||
} | ||
|
||
private void registerForgeTags() { | ||
this.getBuilder(Tags.Items.BOOKSHELVES).add(InspirationsTags.Items.BOOKSHELVES); | ||
|
||
// TODO: Once recipe pulse is reenabled. | ||
if (Inspirations.pulseManager.isPulseLoaded(InspirationsRecipes.pulseID)) { | ||
for(DyeColor color : DyeColor.values()) { | ||
Tag<Item> tag = ItemTags.getCollection() | ||
.getOrCreate(new ResourceLocation("forge", "dyes/" + color.getName())); | ||
this.getBuilder(tag).add(InspirationsRecipes.simpleDyedWaterBottle.get(color)); | ||
} | ||
this.getBuilder(Tags.Items.DYES).add((Item[]) InspirationsRecipes.simpleDyedWaterBottle.values().toArray()); | ||
} | ||
} | ||
|
||
private void registerVanillaTags() { | ||
this.getBuilder(ItemTags.ARROWS).add(InspirationsTools.redstoneArrow); | ||
this.copy(BlockTags.LEAVES, ItemTags.LEAVES); | ||
this.copy(BlockTags.WOODEN_TRAPDOORS, ItemTags.WOODEN_TRAPDOORS); | ||
} | ||
} |
30 changes: 24 additions & 6 deletions
30
src/main/java/knightminer/inspirations/library/InspirationsTags.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,48 @@ | ||
package knightminer.inspirations.library; | ||
|
||
import knightminer.inspirations.Inspirations; | ||
import net.minecraft.block.Block; | ||
import net.minecraft.item.Item; | ||
import net.minecraft.tags.BlockTags; | ||
import net.minecraft.tags.ItemTags; | ||
import net.minecraft.tags.Tag; | ||
import net.minecraft.util.ResourceLocation; | ||
|
||
public class InspirationsTags { | ||
|
||
public static class Blocks { | ||
public static final Tag<Block> MULCH = new BlockTags.Wrapper(Util.getResource("mulch")); | ||
public static final Tag<Block> SMALL_FLOWERS = new BlockTags.Wrapper(Util.getResource("small_flowers")); | ||
public static final Tag<Block> CARPETED_TRAPDOORS = new BlockTags.Wrapper(Util.getResource("carpeted_trapdoors")); | ||
public static final Tag<Block> CARPETED_PRESSURE_PLATES = new BlockTags.Wrapper(Util.getResource("carpeted_pressure_plates")); | ||
public static final Tag<Block> BOOKSHELVES = new BlockTags.Wrapper(Util.getResource("bookshelves")); | ||
public static final Tag<Block> ENLIGHTENED_BUSHES = new BlockTags.Wrapper(Util.getResource("enlightened_bushes")); | ||
|
||
// Blocks with this tag act as fire for the cauldron. | ||
public static final Tag<Block> CAULDRON_FIRE = new BlockTags.Wrapper(new ResourceLocation(Inspirations.modID, "cauldron_fire")); | ||
public static final Tag<Block> CAULDRON_FIRE = new BlockTags.Wrapper(Util.getResource("cauldron_fire")); | ||
} | ||
|
||
public static class Items { | ||
// Duplicates of above. | ||
public static final Tag<Item> MULCH = new ItemTags.Wrapper(Util.getResource("mulch")); | ||
public static final Tag<Item> SMALL_FLOWERS = new ItemTags.Wrapper(Util.getResource("small_flowers")); | ||
public static final Tag<Item> CARPETED_TRAPDOORS = new ItemTags.Wrapper(Util.getResource("carpeted_trapdoors")); | ||
public static final Tag<Item> BOOKSHELVES = new ItemTags.Wrapper(Util.getResource("bookshelves")); | ||
public static final Tag<Item> ENLIGHTENED_BUSHES = new ItemTags.Wrapper(Util.getResource("enlightened_bushes")); | ||
|
||
// Items with this tag are registered to perform cauldron recipes. | ||
public static final Tag<Item> DISP_CAULDRON_RECIPES = new ItemTags.Wrapper(new ResourceLocation(Inspirations.modID, "cauldron_recipes")); | ||
public static final Tag<Item> DISP_CAULDRON_RECIPES = new ItemTags.Wrapper(Util.getResource("cauldron_recipes")); | ||
|
||
// Items with this tag are registered to have fluid tank functionality. | ||
public static final Tag<Item> DISP_FLUID_TANKS = new ItemTags.Wrapper(new ResourceLocation(Inspirations.modID, "fluid_containers")); | ||
public static final Tag<Item> DISP_FLUID_TANKS = new ItemTags.Wrapper(Util.getResource( "fluid_containers")); | ||
|
||
public static final Tag<Item> MILK_CONTAINERS = new ItemTags.Wrapper(Util.getResource("milk_containers")); | ||
|
||
// Items which are valid to be placed on bookshelves. | ||
public static final Tag<Item> BOOKS = new ItemTags.Wrapper(Util.getResource("books")); | ||
|
||
public static final Tag<Item> MILK_CONTAINERS = new ItemTags.Wrapper(new ResourceLocation(Inspirations.modID, "milk_containers")); | ||
// Vanilla carpets, for recipe use. | ||
public static final Tag<Item> CARPETS = new ItemTags.Wrapper(Util.getResource("carpets")); | ||
|
||
public static final Tag<Item> WAYPOINT_COMPASSES = new ItemTags.Wrapper(Util.getResource("waypoint_compasses")); | ||
public static final Tag<Item> DYE_BOTTLES = new ItemTags.Wrapper(Util.getResource("dyed_water_bottles")); | ||
} | ||
} |