Initial Commit
This commit is contained in:
commit
7431d8fc42
25 changed files with 2604 additions and 0 deletions
72
src/main/java/com/oitsjustjose/itemgator/ItemGator.java
Normal file
72
src/main/java/com/oitsjustjose/itemgator/ItemGator.java
Normal file
|
|
@ -0,0 +1,72 @@
|
|||
package com.oitsjustjose.itemgator;
|
||||
|
||||
|
||||
import com.oitsjustjose.itemgator.common.data.RecipeTypeRegistry;
|
||||
import net.minecraft.world.item.Item;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.TickEvent;
|
||||
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||
import net.minecraftforge.fml.common.Mod;
|
||||
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
|
||||
import net.minecraftforge.registries.DeferredRegister;
|
||||
import net.minecraftforge.registries.ForgeRegistries;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
@Mod(ItemGator.MOD_ID)
|
||||
public class ItemGator {
|
||||
public static final String MOD_ID = "itemgator";
|
||||
|
||||
public final RecipeTypeRegistry CustomRecipeRegistry = new RecipeTypeRegistry();
|
||||
|
||||
private static ItemGator instance;
|
||||
|
||||
public ItemGator() {
|
||||
instance = this;
|
||||
|
||||
if (true) {
|
||||
DeferredRegister<Item> ItemRegistry = DeferredRegister.create(ForgeRegistries.ITEMS, MOD_ID);
|
||||
ItemRegistry.register("beans", () -> new Item(new Item.Properties().stacksTo(3)));
|
||||
ItemRegistry.register(FMLJavaModLoadingContext.get().getModEventBus());
|
||||
}
|
||||
|
||||
MinecraftForge.EVENT_BUS.register(this);
|
||||
|
||||
CustomRecipeRegistry.SERIALIZERS.register(FMLJavaModLoadingContext.get().getModEventBus());
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onOther(TickEvent.PlayerTickEvent event) {
|
||||
if (event.player.isCreative()) return;
|
||||
if (event.player.level().isClientSide()) return;
|
||||
|
||||
var inventory = event.player.getInventory();
|
||||
var allRecipes = this.CustomRecipeRegistry.getAllRecipes();
|
||||
|
||||
Arrays.asList(inventory.items, inventory.armor, inventory.offhand).forEach(compartment -> {
|
||||
for (int i = 0; i < compartment.size(); i++) {
|
||||
var stack = compartment.get(i);
|
||||
if (stack.isEmpty()) continue;
|
||||
|
||||
// Check to see if we should be replacing this item with a substitute
|
||||
var shouldReplace = allRecipes.stream().filter(x -> x.matchesOriginal(stack) && x.appliesTo(event.player)).findFirst();
|
||||
if (shouldReplace.isPresent()) {
|
||||
var sub = shouldReplace.get().getSubstitute(stack);
|
||||
inventory.setItem(i, sub);
|
||||
continue;
|
||||
}
|
||||
|
||||
// See if this is a substitute and we should be replacing this item with its original because the player has the needed tag
|
||||
var shouldRevert = allRecipes.stream().filter(x -> x.matchesSubstitute(stack) && !x.appliesTo(event.player)).findFirst();
|
||||
if (shouldRevert.isPresent()) {
|
||||
var orig = shouldRevert.get().getOriginal(stack);
|
||||
inventory.setItem(i, orig);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public static ItemGator getInstance() {
|
||||
return instance;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
package com.oitsjustjose.itemgator.common.data;
|
||||
|
||||
import net.minecraft.world.entity.player.Player;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
|
||||
public abstract class BaseRecipe {
|
||||
public abstract boolean matchesOriginal(ItemStack stackIn);
|
||||
|
||||
public abstract boolean matchesSubstitute(ItemStack stackIn);
|
||||
|
||||
public abstract boolean appliesTo(Player player);
|
||||
|
||||
public abstract ItemStack getSubstitute(ItemStack original);
|
||||
|
||||
public abstract ItemStack getOriginal(ItemStack substitute);
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,52 @@
|
|||
package com.oitsjustjose.itemgator.common.data;
|
||||
|
||||
import com.oitsjustjose.itemgator.ItemGator;
|
||||
import com.oitsjustjose.itemgator.common.data.ingredient.IngredientRecipe;
|
||||
import com.oitsjustjose.itemgator.common.data.ingredient.IngredientRecipeSerializer;
|
||||
import com.oitsjustjose.itemgator.common.data.ingredient.IngredientRecipeType;
|
||||
import com.oitsjustjose.itemgator.common.data.mod.ModRecipe;
|
||||
import com.oitsjustjose.itemgator.common.data.mod.ModRecipeSerializer;
|
||||
import com.oitsjustjose.itemgator.common.data.mod.ModRecipeType;
|
||||
import net.minecraft.world.item.crafting.RecipeSerializer;
|
||||
import net.minecraft.world.item.crafting.RecipeType;
|
||||
import net.minecraftforge.registries.DeferredRegister;
|
||||
import net.minecraftforge.registries.ForgeRegistries;
|
||||
import org.apache.commons.compress.utils.Lists;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class RecipeTypeRegistry {
|
||||
public final DeferredRegister<RecipeSerializer<?>> SERIALIZERS = DeferredRegister.create(ForgeRegistries.RECIPE_SERIALIZERS, ItemGator.MOD_ID);
|
||||
public final DeferredRegister<RecipeType<?>> TYPES = DeferredRegister.create(ForgeRegistries.RECIPE_TYPES, ItemGator.MOD_ID);
|
||||
|
||||
public final RecipeSerializer<ModRecipe> MOD;
|
||||
public final RecipeType<ModRecipe> MOD_TYPE;
|
||||
|
||||
public final RecipeSerializer<IngredientRecipe> INGREDIENT;
|
||||
public final RecipeType<IngredientRecipe> INGREDIENT_TYPE;
|
||||
|
||||
|
||||
private final List<BaseRecipe> allRecipes;
|
||||
|
||||
public RecipeTypeRegistry() {
|
||||
this.allRecipes = Lists.newArrayList();
|
||||
|
||||
this.MOD = new ModRecipeSerializer();
|
||||
this.MOD_TYPE = new ModRecipeType();
|
||||
SERIALIZERS.register("mod", () -> this.MOD);
|
||||
TYPES.register("mod", () -> this.MOD_TYPE);
|
||||
|
||||
this.INGREDIENT = new IngredientRecipeSerializer();
|
||||
this.INGREDIENT_TYPE = new IngredientRecipeType();
|
||||
SERIALIZERS.register("ingredient", () -> this.INGREDIENT);
|
||||
TYPES.register("ingredient", () -> this.INGREDIENT_TYPE);
|
||||
}
|
||||
|
||||
public List<BaseRecipe> getAllRecipes() {
|
||||
return this.allRecipes;
|
||||
}
|
||||
|
||||
public void registerRecipe(BaseRecipe recipe) {
|
||||
this.allRecipes.add(recipe);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,134 @@
|
|||
package com.oitsjustjose.itemgator.common.data.ingredient;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import com.oitsjustjose.itemgator.ItemGator;
|
||||
import com.oitsjustjose.itemgator.common.data.BaseRecipe;
|
||||
import net.minecraft.core.RegistryAccess;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.world.entity.player.Player;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.item.crafting.Ingredient;
|
||||
import net.minecraft.world.item.crafting.Recipe;
|
||||
import net.minecraft.world.item.crafting.RecipeSerializer;
|
||||
import net.minecraft.world.item.crafting.RecipeType;
|
||||
import net.minecraft.world.level.Level;
|
||||
import net.minecraftforge.items.wrapper.RecipeWrapper;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class IngredientRecipe extends BaseRecipe implements Recipe<RecipeWrapper> {
|
||||
public final ResourceLocation id;
|
||||
private final Ingredient ingredient;
|
||||
private final ItemStack substitute;
|
||||
private final List<String> tags;
|
||||
|
||||
public IngredientRecipe(ResourceLocation id, Ingredient ingredient, ItemStack substitute, List<String> tags) {
|
||||
this.id = id;
|
||||
this.ingredient = ingredient;
|
||||
this.substitute = substitute;
|
||||
this.tags = tags;
|
||||
ItemGator.getInstance().CustomRecipeRegistry.registerRecipe(this);
|
||||
}
|
||||
|
||||
public IngredientRecipe(ResourceLocation id, Ingredient ingredient, ItemStack substitute, String tag) {
|
||||
this.id = id;
|
||||
this.ingredient = ingredient;
|
||||
this.substitute = substitute;
|
||||
this.tags = Lists.newArrayList(tag);
|
||||
ItemGator.getInstance().CustomRecipeRegistry.registerRecipe(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean matches(@NotNull RecipeWrapper wrapper, @NotNull Level level) {
|
||||
var stack = wrapper.getItem(0);
|
||||
return this.matchesOriginal(stack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull ItemStack assemble(@NotNull RecipeWrapper unused, @NotNull RegistryAccess unused2) {
|
||||
return this.substitute;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canCraftInDimensions(int _a, int _b) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull ItemStack getResultItem(@NotNull RegistryAccess unused) {
|
||||
return this.substitute;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull ResourceLocation getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull RecipeSerializer<?> getSerializer() {
|
||||
return ItemGator.getInstance().CustomRecipeRegistry.MOD;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull RecipeType<?> getType() {
|
||||
return ItemGator.getInstance().CustomRecipeRegistry.MOD_TYPE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean matchesOriginal(ItemStack stackIn) {
|
||||
return this.ingredient.test(stackIn);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean matchesSubstitute(ItemStack stackIn) {
|
||||
return stackIn.getItem() == this.substitute.getItem();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getSubstitute(ItemStack original) {
|
||||
var stack = substitute.copy();
|
||||
var tag = stack.getOrCreateTag();
|
||||
tag.put("original", original.serializeNBT());
|
||||
stack.setTag(tag);
|
||||
return stack;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getOriginal(ItemStack substitute) {
|
||||
if (!substitute.hasTag()) {
|
||||
// TODO: WARNING
|
||||
return substitute;
|
||||
}
|
||||
|
||||
var tag = substitute.getTag();
|
||||
if (tag == null) {
|
||||
// TODO: WARNING
|
||||
return substitute;
|
||||
}
|
||||
|
||||
return ItemStack.of(tag.getCompound("original"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean appliesTo(Player player) {
|
||||
for (var tag : this.tags) {
|
||||
if (!player.getTags().contains(tag)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public List<String> getTags() {
|
||||
return this.tags;
|
||||
}
|
||||
|
||||
public Ingredient getIngredient() {
|
||||
return this.ingredient;
|
||||
}
|
||||
|
||||
public ItemStack getPlainSubstitute() {
|
||||
return this.substitute.copy();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,51 @@
|
|||
package com.oitsjustjose.itemgator.common.data.ingredient;
|
||||
|
||||
import com.google.gson.JsonObject;
|
||||
import net.minecraft.network.FriendlyByteBuf;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.world.item.crafting.Ingredient;
|
||||
import net.minecraft.world.item.crafting.RecipeSerializer;
|
||||
import net.minecraft.world.item.crafting.ShapedRecipe;
|
||||
import net.minecraftforge.common.crafting.CraftingHelper;
|
||||
import org.apache.commons.compress.utils.Lists;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public class IngredientRecipeSerializer implements RecipeSerializer<IngredientRecipe> {
|
||||
@Override
|
||||
public @NotNull IngredientRecipe fromJson(@NotNull ResourceLocation id, @NotNull JsonObject obj) {
|
||||
// TODO: better validation
|
||||
|
||||
var input = Ingredient.fromJson(obj.get("input"), false);
|
||||
var substitute = ShapedRecipe.itemStackFromJson(obj.getAsJsonObject("substitute"));
|
||||
substitute.setCount(1);
|
||||
List<String> tags = Lists.newArrayList();
|
||||
|
||||
if (obj.has("tags")) {
|
||||
obj.getAsJsonArray("tags").forEach(x -> tags.add(x.getAsString()));
|
||||
} else {
|
||||
tags.add(obj.get("tag").getAsString());
|
||||
}
|
||||
|
||||
return new IngredientRecipe(id, input, substitute, tags);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void toNetwork(@NotNull FriendlyByteBuf buf, @NotNull IngredientRecipe recipe) {
|
||||
CraftingHelper.write(buf, recipe.getIngredient());
|
||||
buf.writeItemStack(recipe.getPlainSubstitute(), false);
|
||||
buf.writeUtf(recipe.getTags().stream().collect(Collectors.joining(",")));
|
||||
}
|
||||
|
||||
@Override
|
||||
public @Nullable IngredientRecipe fromNetwork(@NotNull ResourceLocation id, @NotNull FriendlyByteBuf buf) {
|
||||
var ingredient = Ingredient.fromNetwork(buf);
|
||||
var substitute = buf.readItem();
|
||||
var tags = Arrays.stream(buf.readUtf().split(",")).toList();
|
||||
return new IngredientRecipe(id, ingredient, substitute, tags);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
package com.oitsjustjose.itemgator.common.data.ingredient;
|
||||
|
||||
import com.oitsjustjose.itemgator.ItemGator;
|
||||
import net.minecraft.world.item.crafting.RecipeType;
|
||||
|
||||
public class IngredientRecipeType implements RecipeType<IngredientRecipe> {
|
||||
@Override
|
||||
public String toString() {
|
||||
return ItemGator.MOD_ID + ":ingredient";
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,135 @@
|
|||
package com.oitsjustjose.itemgator.common.data.mod;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import com.oitsjustjose.itemgator.ItemGator;
|
||||
import com.oitsjustjose.itemgator.common.data.BaseRecipe;
|
||||
import net.minecraft.core.RegistryAccess;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.world.entity.player.Player;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.item.crafting.Recipe;
|
||||
import net.minecraft.world.item.crafting.RecipeSerializer;
|
||||
import net.minecraft.world.item.crafting.RecipeType;
|
||||
import net.minecraft.world.level.Level;
|
||||
import net.minecraftforge.items.wrapper.RecipeWrapper;
|
||||
import net.minecraftforge.registries.ForgeRegistries;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class ModRecipe extends BaseRecipe implements Recipe<RecipeWrapper> {
|
||||
public final ResourceLocation id;
|
||||
private final String mod;
|
||||
private final ItemStack substitute;
|
||||
private final List<String> tags;
|
||||
|
||||
public ModRecipe(ResourceLocation id, String mod, ItemStack substitute, List<String> tags) {
|
||||
this.id = id;
|
||||
this.mod = mod;
|
||||
this.substitute = substitute;
|
||||
this.tags = tags;
|
||||
ItemGator.getInstance().CustomRecipeRegistry.registerRecipe(this);
|
||||
}
|
||||
|
||||
public ModRecipe(ResourceLocation id, String mod, ItemStack substitute, String tag) {
|
||||
this.id = id;
|
||||
this.mod = mod;
|
||||
this.substitute = substitute;
|
||||
this.tags = Lists.newArrayList(tag);
|
||||
ItemGator.getInstance().CustomRecipeRegistry.registerRecipe(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean matches(@NotNull RecipeWrapper wrapper, @NotNull Level level) {
|
||||
var stack = wrapper.getItem(0);
|
||||
return this.matchesOriginal(stack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull ItemStack assemble(@NotNull RecipeWrapper unused, @NotNull RegistryAccess unused2) {
|
||||
return this.substitute;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canCraftInDimensions(int _a, int _b) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull ItemStack getResultItem(@NotNull RegistryAccess unused) {
|
||||
return this.substitute;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull ResourceLocation getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull RecipeSerializer<?> getSerializer() {
|
||||
return ItemGator.getInstance().CustomRecipeRegistry.MOD;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull RecipeType<?> getType() {
|
||||
return ItemGator.getInstance().CustomRecipeRegistry.MOD_TYPE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean matchesOriginal(ItemStack stackIn) {
|
||||
var rl = ForgeRegistries.ITEMS.getKey(stackIn.getItem());
|
||||
return rl != null && rl.getNamespace().equals(this.mod);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean matchesSubstitute(ItemStack stackIn) {
|
||||
return stackIn.getItem() == this.substitute.getItem();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getSubstitute(ItemStack original) {
|
||||
var stack = substitute.copy();
|
||||
var tag = stack.getOrCreateTag();
|
||||
tag.put("original", original.serializeNBT());
|
||||
stack.setTag(tag);
|
||||
return stack;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getOriginal(ItemStack substitute) {
|
||||
if (!substitute.hasTag()) {
|
||||
// TODO: WARNING
|
||||
return substitute;
|
||||
}
|
||||
|
||||
var tag = substitute.getTag();
|
||||
if (tag == null) {
|
||||
// TODO: WARNING
|
||||
return substitute;
|
||||
}
|
||||
|
||||
return ItemStack.of(tag.getCompound("original"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean appliesTo(Player player) {
|
||||
for (var tag : this.tags) {
|
||||
if (!player.getTags().contains(tag)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public List<String> getTags() {
|
||||
return this.tags;
|
||||
}
|
||||
|
||||
public String getMod() {
|
||||
return mod;
|
||||
}
|
||||
|
||||
public ItemStack getPlainSubstitute() {
|
||||
return this.substitute.copy();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,49 @@
|
|||
package com.oitsjustjose.itemgator.common.data.mod;
|
||||
|
||||
import net.minecraft.network.FriendlyByteBuf;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.world.item.crafting.RecipeSerializer;
|
||||
import net.minecraft.world.item.crafting.ShapedRecipe;
|
||||
import org.apache.commons.compress.utils.Lists;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import com.google.gson.JsonObject;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public class ModRecipeSerializer implements RecipeSerializer<ModRecipe> {
|
||||
@Override
|
||||
public @NotNull ModRecipe fromJson(@NotNull ResourceLocation id, @NotNull JsonObject obj) {
|
||||
// TODO: better validation
|
||||
|
||||
var mod = obj.get("mod").getAsString();
|
||||
var substitute = ShapedRecipe.itemStackFromJson(obj.getAsJsonObject("substitute"));
|
||||
substitute.setCount(1);
|
||||
List<String> tags = Lists.newArrayList();
|
||||
|
||||
if (obj.has("tags")) {
|
||||
obj.getAsJsonArray("tags").forEach(x -> tags.add(x.getAsString()));
|
||||
} else {
|
||||
tags.add(obj.get("tag").getAsString());
|
||||
}
|
||||
|
||||
return new ModRecipe(id, mod, substitute, tags);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void toNetwork(@NotNull FriendlyByteBuf buf, @NotNull ModRecipe recipe) {
|
||||
buf.writeUtf(recipe.getMod());
|
||||
buf.writeItemStack(recipe.getPlainSubstitute(), false);
|
||||
buf.writeUtf(recipe.getTags().stream().collect(Collectors.joining(",")));
|
||||
}
|
||||
|
||||
@Override
|
||||
public @Nullable ModRecipe fromNetwork(@NotNull ResourceLocation id, @NotNull FriendlyByteBuf buf) {
|
||||
var mod = buf.readUtf();
|
||||
var substitute = buf.readItem();
|
||||
var tags = Arrays.stream(buf.readUtf().split(",")).toList();
|
||||
return new ModRecipe(id, mod, substitute, tags);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
package com.oitsjustjose.itemgator.common.data.mod;
|
||||
|
||||
import com.oitsjustjose.itemgator.ItemGator;
|
||||
import net.minecraft.world.item.crafting.RecipeType;
|
||||
|
||||
public class ModRecipeType implements RecipeType<ModRecipe> {
|
||||
@Override
|
||||
public String toString() {
|
||||
return ItemGator.MOD_ID + ":mod";
|
||||
}
|
||||
}
|
||||
26
src/main/resources/META-INF/mods.toml
Normal file
26
src/main/resources/META-INF/mods.toml
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
modLoader = "javafml"
|
||||
loaderVersion = "[47,)"
|
||||
license = "GNU GPLv3"
|
||||
|
||||
[[mods]]
|
||||
modId = "itemgator"
|
||||
version = "${file.jarVersion}"
|
||||
displayName = "Item Gator"
|
||||
displayURL = "http://github.com/oitsjustjose/itemgator"
|
||||
credits = ""
|
||||
authors = "oitsjustjose"
|
||||
description = '''A mod that allows you to prevent players from picking up / getting an item until they have a given tag'''
|
||||
|
||||
[[dependencies.itemgator]]
|
||||
modId = "forge"
|
||||
mandatory = true
|
||||
versionRange = "[47,)"
|
||||
ordering = "NONE"
|
||||
side = "BOTH"
|
||||
|
||||
[[dependencies.itemgator]]
|
||||
modId = "minecraft"
|
||||
mandatory = true
|
||||
versionRange = "[1.20,)"
|
||||
ordering = "NONE"
|
||||
side = "BOTH"
|
||||
6
src/main/resources/data/minecraft/recipes/test.json
Normal file
6
src/main/resources/data/minecraft/recipes/test.json
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"type": "itemgator:ingredient",
|
||||
"input": { "tag": "minecraft:planks" },
|
||||
"substitute": { "item": "itemgator:beans" },
|
||||
"tag": "beans"
|
||||
}
|
||||
6
src/main/resources/pack.mcmeta
Normal file
6
src/main/resources/pack.mcmeta
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"pack": {
|
||||
"description": "ItemGator Resources",
|
||||
"pack_format": 18
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue