Initial commit
This commit is contained in:
parent
75febf65ae
commit
10a7b4ce1b
30 changed files with 1215 additions and 0 deletions
4
src/generated/resources/.cache/cache
Normal file
4
src/generated/resources/.cache/cache
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
b388f2daddf0d0c8bf442a294899b42da789c7c5 data/predench/advancements/recipes/predench/strange_writing_book.json
|
||||
9743ab5fcdf849f71bda79573eaba034390f0996 data/predench/advancements/recipes/predench/vitriolic_feather.json
|
||||
5ae3494cda14b080932ba55e3617137474dcce89 data/predench/recipes/strange_writing_book.json
|
||||
e7496726b3f82b79d7aca49fe3cf9a375825e858 data/predench/recipes/vitriolic_feather.json
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
{
|
||||
"parent": "minecraft:recipes/root",
|
||||
"rewards": {
|
||||
"recipes": [
|
||||
"predench:strange_writing_book"
|
||||
]
|
||||
},
|
||||
"criteria": {
|
||||
"has_vitriolic_feather": {
|
||||
"trigger": "minecraft:inventory_changed",
|
||||
"conditions": {
|
||||
"items": [
|
||||
{
|
||||
"items": [
|
||||
"predench:vitriolic_feather"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"has_the_recipe": {
|
||||
"trigger": "minecraft:recipe_unlocked",
|
||||
"conditions": {
|
||||
"recipe": "predench:strange_writing_book"
|
||||
}
|
||||
}
|
||||
},
|
||||
"requirements": [
|
||||
[
|
||||
"has_vitriolic_feather",
|
||||
"has_the_recipe"
|
||||
]
|
||||
]
|
||||
}
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
{
|
||||
"parent": "minecraft:recipes/root",
|
||||
"rewards": {
|
||||
"recipes": [
|
||||
"predench:vitriolic_feather"
|
||||
]
|
||||
},
|
||||
"criteria": {
|
||||
"has_copper": {
|
||||
"trigger": "minecraft:inventory_changed",
|
||||
"conditions": {
|
||||
"items": [
|
||||
{
|
||||
"tag": "forge:ingots/copper"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"has_the_recipe": {
|
||||
"trigger": "minecraft:recipe_unlocked",
|
||||
"conditions": {
|
||||
"recipe": "predench:vitriolic_feather"
|
||||
}
|
||||
}
|
||||
},
|
||||
"requirements": [
|
||||
[
|
||||
"has_copper",
|
||||
"has_the_recipe"
|
||||
]
|
||||
]
|
||||
}
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
{
|
||||
"type": "minecraft:crafting_shapeless",
|
||||
"ingredients": [
|
||||
{
|
||||
"item": "predench:vitriolic_feather"
|
||||
},
|
||||
{
|
||||
"item": "minecraft:book"
|
||||
},
|
||||
{
|
||||
"item": "minecraft:glow_ink_sac"
|
||||
}
|
||||
],
|
||||
"result": {
|
||||
"item": "predench:strange_writing_book"
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
{
|
||||
"type": "minecraft:crafting_shaped",
|
||||
"pattern": [
|
||||
" C ",
|
||||
"CFC",
|
||||
" C "
|
||||
],
|
||||
"key": {
|
||||
"C": {
|
||||
"item": "minecraft:copper_block"
|
||||
},
|
||||
"F": {
|
||||
"tag": "forge:feathers"
|
||||
}
|
||||
},
|
||||
"result": {
|
||||
"item": "predench:vitriolic_feather"
|
||||
}
|
||||
}
|
||||
63
src/main/java/xyz/nuark/predench/EnchantmentData.java
Normal file
63
src/main/java/xyz/nuark/predench/EnchantmentData.java
Normal file
|
|
@ -0,0 +1,63 @@
|
|||
package xyz.nuark.predench;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.JsonObject;
|
||||
import com.mojang.datafixers.types.templates.CompoundList;
|
||||
import com.mojang.datafixers.types.templates.TypeTemplate;
|
||||
import net.minecraft.nbt.*;
|
||||
import net.minecraft.util.StringUtil;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import java.io.DataOutput;
|
||||
import java.io.IOException;
|
||||
import java.util.LinkedList;
|
||||
|
||||
public class EnchantmentData {
|
||||
private final LinkedList<LinkedList<Enchantment>> tiers;
|
||||
|
||||
public EnchantmentData() {
|
||||
this.tiers = new LinkedList<>();
|
||||
tiers.add(new LinkedList<>());
|
||||
tiers.add(new LinkedList<>());
|
||||
tiers.add(new LinkedList<>());
|
||||
}
|
||||
|
||||
public void addToTier(int tier, Enchantment enchantment) {
|
||||
tiers.get(tier).add(enchantment);
|
||||
}
|
||||
|
||||
public LinkedList<Enchantment> getTier(int tier) {
|
||||
return tiers.get(tier);
|
||||
}
|
||||
|
||||
public ListTag convertToBookPages() {
|
||||
String[] pages = {"", "", ""};
|
||||
|
||||
for (int i = 0; i < 3; i++) {
|
||||
if (tiers.get(i).isEmpty()) {
|
||||
pages[i] += "Tier " + (i + 1) + "\n";
|
||||
pages[i] += "======\n";
|
||||
pages[i] += "No enchantments";
|
||||
} else {
|
||||
pages[i] += "Tier " + (i + 1) + " at " + tiers.get(i).get(0).cost + "\n";
|
||||
pages[i] += "======\n";
|
||||
for (Enchantment enchantment : tiers.get(i)) {
|
||||
pages[i] += enchantment.name + "\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ListTag list = new ListTag();
|
||||
|
||||
for (int i = 0; i < 3; i++) {
|
||||
JsonObject json = new JsonObject();
|
||||
json.addProperty("text", pages[i]);
|
||||
list.add(StringTag.valueOf(json.toString()));
|
||||
}
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
public record Enchantment(String name, int level, int cost) {
|
||||
}
|
||||
}
|
||||
38
src/main/java/xyz/nuark/predench/Predench.java
Normal file
38
src/main/java/xyz/nuark/predench/Predench.java
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
package xyz.nuark.predench;
|
||||
|
||||
import com.mojang.logging.LogUtils;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.world.item.CreativeModeTab;
|
||||
import net.minecraft.world.item.Item;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.item.Rarity;
|
||||
import net.minecraftforge.fml.common.Mod;
|
||||
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
|
||||
import net.minecraftforge.registries.DeferredRegister;
|
||||
import net.minecraftforge.registries.ForgeRegistries;
|
||||
import net.minecraftforge.registries.RegistryObject;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
@Mod(Predench.MOD_ID)
|
||||
public class Predench {
|
||||
public static final String MOD_ID = "predench";
|
||||
public static final Logger LOGGER = LogUtils.getLogger();
|
||||
|
||||
// Really necessary to create item group for two items :)
|
||||
public static final CreativeModeTab ITEM_GROUP = new CreativeModeTab("predench") {
|
||||
@Override
|
||||
public @NotNull ItemStack makeIcon() {
|
||||
return new ItemStack(VITRIOLIC_FEATHER_ITEM.get());
|
||||
}
|
||||
};
|
||||
|
||||
// Only two items, no need to create holder class
|
||||
private static final DeferredRegister<Item> ITEMS = DeferredRegister.create(ForgeRegistries.ITEMS, Predench.MOD_ID);
|
||||
public static final RegistryObject<Item> VITRIOLIC_FEATHER_ITEM = ITEMS.register("vitriolic_feather", () -> new Item(new Item.Properties().tab(Predench.ITEM_GROUP).stacksTo(16).fireResistant().rarity(Rarity.RARE)));
|
||||
public static final RegistryObject<Item> STRANGE_WRITING_BOOK_ITEM = ITEMS.register("strange_writing_book", () -> new Item(new Item.Properties().tab(Predench.ITEM_GROUP).stacksTo(1).fireResistant().rarity(Rarity.EPIC)));
|
||||
|
||||
public Predench() {
|
||||
ITEMS.register(FMLJavaModLoadingContext.get().getModEventBus());
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
package xyz.nuark.predench;
|
||||
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.level.Level;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
public interface PredenchEnchantmentDataExtractor {
|
||||
Optional<EnchantmentData> getEnchantmentData(Level level, BlockPos tablePos, ItemStack itemstack);
|
||||
}
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
package xyz.nuark.predench;
|
||||
|
||||
import net.minecraft.world.entity.player.Player;
|
||||
|
||||
import java.util.OptionalInt;
|
||||
|
||||
public interface PredenchSeedUpdater {
|
||||
OptionalInt updatePlayerEnchantmentSeed(Player player);
|
||||
}
|
||||
17
src/main/java/xyz/nuark/predench/datagen/DataGenerator.java
Normal file
17
src/main/java/xyz/nuark/predench/datagen/DataGenerator.java
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
package xyz.nuark.predench.datagen;
|
||||
|
||||
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||
import net.minecraftforge.fml.common.Mod;
|
||||
import net.minecraftforge.forge.event.lifecycle.GatherDataEvent;
|
||||
import xyz.nuark.predench.Predench;
|
||||
|
||||
@Mod.EventBusSubscriber(modid = Predench.MOD_ID, bus = Mod.EventBusSubscriber.Bus.MOD)
|
||||
public class DataGenerator {
|
||||
@SubscribeEvent
|
||||
public static void gatherData(GatherDataEvent event) {
|
||||
if (event.includeServer()) {
|
||||
Predench.LOGGER.info("Generating recipes data");
|
||||
event.getGenerator().addProvider(new RecipeGenerator(event.getGenerator()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
package xyz.nuark.predench.datagen;
|
||||
|
||||
import net.minecraft.data.DataGenerator;
|
||||
import net.minecraft.data.recipes.FinishedRecipe;
|
||||
import net.minecraft.data.recipes.RecipeProvider;
|
||||
import net.minecraft.data.recipes.ShapedRecipeBuilder;
|
||||
import net.minecraft.data.recipes.ShapelessRecipeBuilder;
|
||||
import net.minecraft.world.item.Items;
|
||||
import net.minecraftforge.common.Tags;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import xyz.nuark.predench.Predench;
|
||||
|
||||
import java.util.function.Consumer;
|
||||
|
||||
public class RecipeGenerator extends RecipeProvider {
|
||||
public RecipeGenerator(DataGenerator generator) {
|
||||
super(generator);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void buildCraftingRecipes(@NotNull Consumer<FinishedRecipe> consumer) {
|
||||
ShapedRecipeBuilder.shaped(Predench.VITRIOLIC_FEATHER_ITEM.get())
|
||||
.define('C', Items.COPPER_BLOCK)
|
||||
.define('F', Tags.Items.FEATHERS)
|
||||
.pattern(" C ")
|
||||
.pattern("CFC")
|
||||
.pattern(" C ")
|
||||
.unlockedBy("has_copper", has(Tags.Items.INGOTS_COPPER))
|
||||
.save(consumer);
|
||||
|
||||
ShapelessRecipeBuilder.shapeless(Predench.STRANGE_WRITING_BOOK_ITEM.get())
|
||||
.requires(Predench.VITRIOLIC_FEATHER_ITEM.get())
|
||||
.requires(Items.BOOK)
|
||||
.requires(Items.GLOW_INK_SAC)
|
||||
.unlockedBy("has_vitriolic_feather", has(Predench.VITRIOLIC_FEATHER_ITEM.get()))
|
||||
.save(consumer);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,96 @@
|
|||
package xyz.nuark.predench.mixin;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.world.entity.player.Player;
|
||||
import net.minecraft.world.inventory.DataSlot;
|
||||
import net.minecraft.world.inventory.EnchantmentMenu;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.item.enchantment.EnchantmentHelper;
|
||||
import net.minecraft.world.item.enchantment.EnchantmentInstance;
|
||||
import net.minecraft.world.level.Level;
|
||||
import net.minecraft.world.level.block.EnchantmentTableBlock;
|
||||
import org.spongepowered.asm.mixin.Final;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
import xyz.nuark.predench.EnchantmentData;
|
||||
import xyz.nuark.predench.Predench;
|
||||
import xyz.nuark.predench.PredenchEnchantmentDataExtractor;
|
||||
import xyz.nuark.predench.PredenchSeedUpdater;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.OptionalInt;
|
||||
import java.util.Random;
|
||||
|
||||
@Mixin(EnchantmentMenu.class)
|
||||
public abstract class MixinEnchantmentMenu implements PredenchSeedUpdater, PredenchEnchantmentDataExtractor {
|
||||
@Shadow protected abstract List<EnchantmentInstance> getEnchantmentList(ItemStack p_39472_, int p_39473_, int p_39474_);
|
||||
|
||||
public OptionalInt updatePlayerEnchantmentSeed(Player player) {
|
||||
try {
|
||||
player.onEnchantmentPerformed(null, 0);
|
||||
int seed = player.getEnchantmentSeed();
|
||||
enchantmentSeed.set(seed);
|
||||
return OptionalInt.of(seed);
|
||||
} catch (Exception e) {
|
||||
Predench.LOGGER.error("Failed to update enchantment seed for player " + player.getName().getString(), e);
|
||||
}
|
||||
return OptionalInt.empty();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Optional<EnchantmentData> getEnchantmentData(Level level, BlockPos tablePos, ItemStack itemstack) {
|
||||
try {
|
||||
int[] costs = new int[3];
|
||||
float j = 0;
|
||||
|
||||
for(BlockPos blockpos : EnchantmentTableBlock.BOOKSHELF_OFFSETS) {
|
||||
if (EnchantmentTableBlock.isValidBookShelf(level, tablePos, blockpos)) {
|
||||
j += level.getBlockState(tablePos.offset(blockpos)).getEnchantPowerBonus(level, tablePos.offset(blockpos));
|
||||
}
|
||||
}
|
||||
|
||||
Random random = new Random();
|
||||
random.setSeed(this.enchantmentSeed.get());
|
||||
|
||||
for(int k = 0; k < 3; ++k) {
|
||||
costs[k] = EnchantmentHelper.getEnchantmentCost(random, k, (int)j, itemstack);
|
||||
if (costs[k] < k + 1) {
|
||||
costs[k] = 0;
|
||||
}
|
||||
costs[k] = net.minecraftforge.event.ForgeEventFactory.onEnchantmentLevelSet(level, tablePos, k, (int)j, itemstack, costs[k]);
|
||||
}
|
||||
|
||||
EnchantmentData enchantmentData = new EnchantmentData();
|
||||
|
||||
for(int l = 0; l < 3; ++l) {
|
||||
if (costs[l] > 0) {
|
||||
List<EnchantmentInstance> list = this.getEnchantmentList(itemstack, l, costs[l]);
|
||||
if (list != null && !list.isEmpty()) {
|
||||
for (EnchantmentInstance enchantmentInstance : list) {
|
||||
enchantmentData.addToTier(l, new EnchantmentData.Enchantment(
|
||||
enchantmentInstance.enchantment.getFullname(enchantmentInstance.level).getString(),
|
||||
enchantmentInstance.level,
|
||||
costs[l]
|
||||
));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Predench.LOGGER.info("Enchantment data: " + new Gson().toJson(enchantmentData));
|
||||
|
||||
return Optional.of(enchantmentData);
|
||||
} catch (Exception e) {
|
||||
Predench.LOGGER.error("Failed to get enchantment data for itemstack " + itemstack.toString(), e);
|
||||
}
|
||||
|
||||
return Optional.empty();
|
||||
}
|
||||
|
||||
@Final
|
||||
@Shadow
|
||||
private final DataSlot enchantmentSeed = DataSlot.standalone();
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,99 @@
|
|||
package xyz.nuark.predench.mixin;
|
||||
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.nbt.ListTag;
|
||||
import net.minecraft.nbt.StringTag;
|
||||
import net.minecraft.network.chat.TextComponent;
|
||||
import net.minecraft.util.StringUtil;
|
||||
import net.minecraft.world.InteractionHand;
|
||||
import net.minecraft.world.InteractionResult;
|
||||
import net.minecraft.world.MenuProvider;
|
||||
import net.minecraft.world.entity.EquipmentSlot;
|
||||
import net.minecraft.world.entity.player.Player;
|
||||
import net.minecraft.world.inventory.MenuType;
|
||||
import net.minecraft.world.item.*;
|
||||
import net.minecraft.world.item.enchantment.EnchantmentHelper;
|
||||
import net.minecraft.world.level.Level;
|
||||
import net.minecraft.world.level.block.EnchantmentTableBlock;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.phys.BlockHitResult;
|
||||
import net.minecraftforge.common.Tags;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||
import xyz.nuark.predench.EnchantmentData;
|
||||
import xyz.nuark.predench.Predench;
|
||||
import xyz.nuark.predench.PredenchEnchantmentDataExtractor;
|
||||
import xyz.nuark.predench.PredenchSeedUpdater;
|
||||
|
||||
import java.util.Optional;
|
||||
import java.util.OptionalInt;
|
||||
|
||||
@Mixin(EnchantmentTableBlock.class)
|
||||
public class MixinEnchantmentTableBlock {
|
||||
@Inject(method = "use", at = @At("HEAD"), cancellable = true)
|
||||
private void use(BlockState blockState, Level level, BlockPos blockPos, Player player, InteractionHand interactionHand, BlockHitResult blockHitResult, CallbackInfoReturnable<InteractionResult> cir) {
|
||||
Predench.LOGGER.info("EnchantmentTableBlock use finished, injecting our code...");
|
||||
if (!level.isClientSide) {
|
||||
cir.cancel();
|
||||
ItemStack main = player.getMainHandItem();
|
||||
ItemStack off = player.getOffhandItem();
|
||||
Predench.LOGGER.info("Main hand: " + main);
|
||||
Predench.LOGGER.info("Offhand: " + off);
|
||||
|
||||
OptionalInt optionalInt = player.openMenu(blockState.getMenuProvider(level, blockPos));
|
||||
if (optionalInt.isPresent() && player.containerMenu.getType() == MenuType.ENCHANTMENT) {
|
||||
if (main.is(Items.SPONGE) && off.is(Items.WATER_BUCKET)) {
|
||||
if (main.getCount() > 1) {
|
||||
player.displayClientMessage(new TextComponent("You should have exactly one sponge in your hand."), true);
|
||||
} else {
|
||||
updatePlayerEnchantmentSeed(player);
|
||||
}
|
||||
} else if (main.is(Predench.STRANGE_WRITING_BOOK_ITEM.get()) && off.getItem().isEnchantable(off)) {
|
||||
writeBookWithEnchantmentsData(level, blockPos, player, off);
|
||||
}
|
||||
}
|
||||
|
||||
cir.setReturnValue(InteractionResult.CONSUME);
|
||||
}
|
||||
}
|
||||
|
||||
private void updatePlayerEnchantmentSeed(Player player) {
|
||||
if (player.experienceLevel < 3) {
|
||||
player.displayClientMessage(new TextComponent("You need at least 3 levels to use this."), true);
|
||||
} else {
|
||||
OptionalInt newSeed = ((PredenchSeedUpdater) player.containerMenu).updatePlayerEnchantmentSeed(player);
|
||||
if (newSeed.isPresent()) {
|
||||
player.displayClientMessage(new TextComponent("New enchantment seed: " + newSeed.getAsInt()), true);
|
||||
player.giveExperienceLevels(-3);
|
||||
player.setItemSlot(EquipmentSlot.MAINHAND, new ItemStack(Items.WET_SPONGE));
|
||||
player.setItemSlot(EquipmentSlot.OFFHAND, new ItemStack(Items.BUCKET));
|
||||
} else {
|
||||
player.displayClientMessage(new TextComponent("Failed to update enchantment seed."), true);
|
||||
}
|
||||
}
|
||||
player.closeContainer();
|
||||
}
|
||||
|
||||
private void writeBookWithEnchantmentsData(Level level, BlockPos blockPos, Player player, ItemStack off) {
|
||||
if (player.experienceLevel < 3) {
|
||||
player.displayClientMessage(new TextComponent("You need at least 3 levels to use this."), true);
|
||||
} else {
|
||||
ItemStack enchantmentInfoBook = new ItemStack(Items.WRITTEN_BOOK);
|
||||
Optional<EnchantmentData> data = ((PredenchEnchantmentDataExtractor) player.containerMenu).getEnchantmentData(level, blockPos, off);
|
||||
if (data.isPresent()) {
|
||||
CompoundTag nbt = enchantmentInfoBook.getOrCreateTag();
|
||||
nbt.putString("title", "Predench report");
|
||||
nbt.putString("author", "nuark");
|
||||
nbt.put("pages", data.get().convertToBookPages());
|
||||
player.setItemSlot(EquipmentSlot.MAINHAND, enchantmentInfoBook);
|
||||
player.giveExperienceLevels(-10);
|
||||
} else {
|
||||
player.displayClientMessage(new TextComponent("Couldn't retrieve enchantment data."), true);
|
||||
}
|
||||
}
|
||||
player.closeContainer();
|
||||
}
|
||||
}
|
||||
58
src/main/resources/META-INF/mods.toml
Normal file
58
src/main/resources/META-INF/mods.toml
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
# This is an example mods.toml file. It contains the data relating to the loading mods.
|
||||
# There are several mandatory fields (#mandatory), and many more that are optional (#optional).
|
||||
# The overall format is standard TOML format, v0.5.0.
|
||||
# Note that there are a couple of TOML lists in this file.
|
||||
# Find more information on toml format here: https://github.com/toml-lang/toml
|
||||
# The name of the mod loader type to load - for regular FML @Mod mods it should be javafml
|
||||
modLoader = "javafml" #mandatory
|
||||
# A version range to match for said mod loader - for regular FML @Mod it will be the forge version
|
||||
loaderVersion = "[40,)" #mandatory This is typically bumped every Minecraft version by Forge. See our download page for lists of versions.
|
||||
# The license for you mod. This is mandatory metadata and allows for easier comprehension of your redistributive properties.
|
||||
# Review your options at https://choosealicense.com/. All rights reserved is the default copyright stance, and is thus the default here.
|
||||
license = "MIT"
|
||||
# A URL to refer people to when problems occur with this mod
|
||||
#issueTrackerURL="http://my.issue.tracker/" #optional
|
||||
# A list of mods - how many allowed here is determined by the individual mod loader
|
||||
[[mods]] #mandatory
|
||||
# The modid of the mod
|
||||
modId = "predench" #mandatory
|
||||
# The version number of the mod - there's a few well known ${} variables useable here or just hardcode it
|
||||
# ${file.jarVersion} will substitute the value of the Implementation-Version as read from the mod's JAR file metadata
|
||||
# see the associated build.gradle script for how to populate this completely automatically during a build
|
||||
version = "1.0.0" #mandatory
|
||||
# A display name for the mod
|
||||
displayName = "Predench" #mandatory
|
||||
# A URL to query for updates for this mod. See the JSON update specification <here>
|
||||
#updateJSONURL="http://myurl.me/" #optional
|
||||
# A URL for the "homepage" for this mod, displayed in the mod UI
|
||||
#displayURL="http://example.com/" #optional
|
||||
# A file name (in the root of the mod JAR) containing a logo for display
|
||||
#logoFile="predench.png" #optional
|
||||
# A text field displayed in the mod UI
|
||||
#credits="Thanks for this example mod goes to Java" #optional
|
||||
# A text field displayed in the mod UI
|
||||
authors = "nuark" #optional
|
||||
# The description text for the mod (multi line!) (#mandatory)
|
||||
description = '''
|
||||
Predench - predictable enchantments and re-rolls for enchanting table
|
||||
'''
|
||||
# A dependency - use the . to indicate dependency for a specific modid. Dependencies are optional.
|
||||
[[dependencies.predench]] #optional
|
||||
# the modid of the dependency
|
||||
modId = "forge" #mandatory
|
||||
# Does this dependency have to exist - if not, ordering below must be specified
|
||||
mandatory = true #mandatory
|
||||
# The version range of the dependency
|
||||
versionRange = "[40,)" #mandatory
|
||||
# An ordering relationship for the dependency - BEFORE or AFTER required if the relationship is not mandatory
|
||||
ordering = "NONE"
|
||||
# Side this dependency is applied on - BOTH, CLIENT or SERVER
|
||||
side = "BOTH"
|
||||
# Here's another dependency
|
||||
[[dependencies.predench]]
|
||||
modId = "minecraft"
|
||||
mandatory = true
|
||||
# This version range declares a minimum of the current minecraft version up to but not including the next major version
|
||||
versionRange = "[1.18.2,1.19)"
|
||||
ordering = "NONE"
|
||||
side = "BOTH"
|
||||
4
src/main/resources/assets/predench/lang/en_us.json
Normal file
4
src/main/resources/assets/predench/lang/en_us.json
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"item.predench.vitriolic_feather": "Vitriolic Feather",
|
||||
"item.predench.strange_writing_book": "Strange Writing Book"
|
||||
}
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"parent": "item/generated",
|
||||
"textures": {
|
||||
"layer0": "predench:item/strange_writing_book"
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"parent": "item/generated",
|
||||
"textures": {
|
||||
"layer0": "predench:item/vitriolic_feather"
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 313 B |
Binary file not shown.
|
After Width: | Height: | Size: 233 B |
8
src/main/resources/pack.mcmeta
Normal file
8
src/main/resources/pack.mcmeta
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
"pack": {
|
||||
"description": "predench resources",
|
||||
"pack_format": 8,
|
||||
"forge:resource_pack_format": 8,
|
||||
"forge:data_pack_format": 9
|
||||
}
|
||||
}
|
||||
14
src/main/resources/predench.mixins.json
Normal file
14
src/main/resources/predench.mixins.json
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
{
|
||||
"required": true,
|
||||
"minVersion": "0.8",
|
||||
"package": "xyz.nuark.predench.mixin",
|
||||
"compatibilityLevel": "JAVA_8",
|
||||
"refmap": "predench.refmap.json",
|
||||
"mixins": [
|
||||
"MixinEnchantmentMenu",
|
||||
"MixinEnchantmentTableBlock"
|
||||
],
|
||||
"injectors": {
|
||||
"defaultRequire": 1
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue