diff --git a/build.gradle b/build.gradle index ee4213a..aaf8aed 100644 --- a/build.gradle +++ b/build.gradle @@ -110,6 +110,7 @@ dependencies { implementation name: 'lotr' implementation name: 'optifine' implementation name: 'variabletriggers' + implementation name: 'metweaks' if (usesMixins.toBoolean()) { annotationProcessor("io.github.legacymoddingmc:unimixins:0.1.13:dev") diff --git a/libs/metweaks.jar b/libs/metweaks.jar new file mode 100644 index 0000000..944cffe Binary files /dev/null and b/libs/metweaks.jar differ diff --git a/src/main/java/com/zivilon/cinder_loe/mixins/MixinMETweaksCategory.java b/src/main/java/com/zivilon/cinder_loe/mixins/MixinMETweaksCategory.java new file mode 100644 index 0000000..94e06bd --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/mixins/MixinMETweaksCategory.java @@ -0,0 +1,53 @@ +package com.zivilon.cinder_loe.mixins; + +import lotr.common.LOTRMod; +import lotr.common.item.LOTRItemBlowgun; +import lotr.common.item.LOTRItemCrossbow; +import lotr.common.item.LOTRItemPlate; +import lotr.common.item.LOTRItemSpear; +import lotr.common.item.LOTRItemThrowingAxe; + +import metweaks.guards.customranged.CustomRanged.Category; + +import net.minecraft.item.Item; + +import java.util.List; +import java.util.Collections; + +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Overwrite; +import org.spongepowered.asm.mixin.Shadow; + +@Mixin(targets = "metweaks.guards.customranged.CustomRanged$Category") +public class MixinMETweaksCategory { + private static Category SLING = Category.SLING; + private static Category PLATE = Category.PLATE; + private static Category BOW = Category.BOW; + private static Category BLOWGUN = Category.BLOWGUN; + private static Category AXE = Category.AXE; + private static Category CROSSBOW = Category.CROSSBOW; + private static Category SPEAR = Category.SPEAR; + private static Category FIREPOT = Category.FIREPOT; + private static Category TERMITE = Category.TERMITE; + + @Overwrite(remap = false) + public static Category getCategory(Item item) { + if (item instanceof LOTRItemCrossbow) + return CROSSBOW; + if (item == LOTRMod.sling) + return SLING; + if (item instanceof LOTRItemBlowgun) + return BLOWGUN; + if (item == LOTRMod.termite) + return TERMITE; + if (item == LOTRMod.rhunFirePot) + return FIREPOT; + if (item.getClass() == LOTRItemThrowingAxe.class) + return AXE; + if (item.getClass() == LOTRItemPlate.class && item != LOTRMod.woodPlate) + return PLATE; + if (item.getClass() == LOTRItemSpear.class && item != LOTRMod.spearStone) + return SPEAR; + return BOW; + } +} diff --git a/src/main/resources/mixins.cinder_loe.json b/src/main/resources/mixins.cinder_loe.json index b1855f4..fbf809e 100644 --- a/src/main/resources/mixins.cinder_loe.json +++ b/src/main/resources/mixins.cinder_loe.json @@ -69,7 +69,8 @@ "MixinLOTREnchantmentWeaponSpecial", "MixinLOTRTraderNPCInfo", "MixinLOTRGuiTrade", - "MixinLOTRTickHandlerClient" + "MixinLOTRTickHandlerClient", + "MixinMETweaksCategory" ], "client": [] }