fix loot table
This commit is contained in:
@@ -6,7 +6,7 @@ minecraft_version=1.21.10
|
|||||||
yarn_mappings=1.21.10+build.2
|
yarn_mappings=1.21.10+build.2
|
||||||
loader_version=0.17.3
|
loader_version=0.17.3
|
||||||
# Mod Properties
|
# Mod Properties
|
||||||
mod_version=1.6
|
mod_version=1.7
|
||||||
maven_group=com.kasetoatz
|
maven_group=com.kasetoatz
|
||||||
archives_base_name=SuperEnchants
|
archives_base_name=SuperEnchants
|
||||||
# Dependencies
|
# Dependencies
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ public class Config
|
|||||||
Map.entry(Identifier.of("minecraft:impaling"), 10),
|
Map.entry(Identifier.of("minecraft:impaling"), 10),
|
||||||
Map.entry(Identifier.of("minecraft:loyalty"), 5),
|
Map.entry(Identifier.of("minecraft:loyalty"), 5),
|
||||||
Map.entry(Identifier.of("minecraft:riptide"), 5),
|
Map.entry(Identifier.of("minecraft:riptide"), 5),
|
||||||
Map.entry(Identifier.of("minecraft:quick_charge"), 5),
|
Map.entry(Identifier.of("minecraft:quick_charge"), 3),
|
||||||
Map.entry(Identifier.of("minecraft:piercing"), 10)
|
Map.entry(Identifier.of("minecraft:piercing"), 10)
|
||||||
));
|
));
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,20 @@
|
|||||||
|
package com.kasetoatz.superenchants.mixin;
|
||||||
|
|
||||||
|
import net.minecraft.enchantment.Enchantment;
|
||||||
|
import net.minecraft.screen.AnvilScreenHandler;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
|
import org.spongepowered.asm.mixin.injection.Redirect;
|
||||||
|
|
||||||
|
import static com.kasetoatz.superenchants.util.Util.getCustomLevel;
|
||||||
|
|
||||||
|
@Mixin(AnvilScreenHandler.class)
|
||||||
|
public class AnvilScreenHandlerMixin
|
||||||
|
{
|
||||||
|
@Redirect(method="updateResult", at=@At(value="INVOKE", target="Lnet/minecraft/enchantment/Enchantment;getMaxLevel()I"))
|
||||||
|
public int getMaxLevel(Enchantment enchant)
|
||||||
|
{
|
||||||
|
int custom = getCustomLevel(enchant);
|
||||||
|
return (custom > 0) ? custom : enchant.getMaxLevel();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -51,13 +51,8 @@ public class EnchantmentMixin
|
|||||||
@ModifyReturnValue(method="getMaxLevel", at=@At("RETURN"))
|
@ModifyReturnValue(method="getMaxLevel", at=@At("RETURN"))
|
||||||
public int getMaxLevel(int original)
|
public int getMaxLevel(int original)
|
||||||
{
|
{
|
||||||
Enchantment enchantment = (Enchantment)(Object)this;
|
int level = getCustomLevel((Enchantment)(Object)this);
|
||||||
int level = getCustomLevel(enchantment);
|
return (CUSTOM_LEVELS_IN_LOOT_TABLE && level > 0) ? level : original;
|
||||||
if (level > 0)
|
|
||||||
{
|
|
||||||
return level;
|
|
||||||
}
|
|
||||||
return original;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Unique
|
@Unique
|
||||||
|
|||||||
@@ -4,9 +4,10 @@
|
|||||||
"package": "com.kasetoatz.superenchants.mixin",
|
"package": "com.kasetoatz.superenchants.mixin",
|
||||||
"compatibilityLevel": "JAVA_21",
|
"compatibilityLevel": "JAVA_21",
|
||||||
"mixins": [
|
"mixins": [
|
||||||
"ComponentHolderMixin",
|
"AnvilScreenHandlerMixin",
|
||||||
"BowItemMixin",
|
"BowItemMixin",
|
||||||
"ChangeItemDamageEnchantmentEffectMixin",
|
"ChangeItemDamageEnchantmentEffectMixin",
|
||||||
|
"ComponentHolderMixin",
|
||||||
"CrossbowItemMixin",
|
"CrossbowItemMixin",
|
||||||
"EnchantmentMixin",
|
"EnchantmentMixin",
|
||||||
"MerchantEntityMixin",
|
"MerchantEntityMixin",
|
||||||
|
|||||||
Reference in New Issue
Block a user