Skip to content

Commit

Permalink
add config for disabling enchantment in librarian trades
Browse files Browse the repository at this point in the history
  • Loading branch information
MelanX committed Oct 31, 2023
1 parent 80e4a3c commit 595c3b3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/main/java/de/melanx/simplytools/config/ModConfig.java
Expand Up @@ -16,6 +16,9 @@ public class ModConfig {
@FloatRange(min = 0, max = 10)
public static float durabilityModifier = 1.5f;

@Config("If true, new villagers will not have this in their trades")
public static boolean disableEnchantmentForVillagers = false;

@Group
public static class ToolValues {

Expand Down
@@ -1,5 +1,6 @@
package de.melanx.simplytools.enchantments;

import de.melanx.simplytools.config.ModConfig;
import de.melanx.simplytools.items.BaseTool;
import net.minecraft.world.entity.EquipmentSlot;
import net.minecraft.world.item.enchantment.Enchantment;
Expand All @@ -20,4 +21,9 @@ public int getMinCost(int level) {
public int getMaxLevel() {
return 3;
}

@Override
public boolean isTradeable() {
return ModConfig.disableEnchantmentForVillagers;
}
}

0 comments on commit 595c3b3

Please sign in to comment.