From 5735885d7a81e7d4390777afd33071b6c93b4684 Mon Sep 17 00:00:00 2001 From: Estecka Date: Sun, 17 Sep 2023 00:45:07 +0200 Subject: [PATCH] Removed obfuscated method from duck interface. (#5) --- gradle.properties | 2 +- .../tk/estecka/shiftingwares/IVillagerEntityDuck.java | 3 --- .../java/tk/estecka/shiftingwares/MapTradesCache.java | 10 ++++++---- .../java/tk/estecka/shiftingwares/TradeShuffler.java | 6 ++---- .../shiftingwares/mixin/VillagerEntityMixin.java | 4 ++-- 5 files changed, 11 insertions(+), 14 deletions(-) diff --git a/gradle.properties b/gradle.properties index 245b8ab..8041b9e 100644 --- a/gradle.properties +++ b/gradle.properties @@ -9,7 +9,7 @@ yarn_mappings=1.20.1+build.10 loader_version=0.14.22 # Mod Properties -mod_version=1.0.3 +mod_version=1.0.4 maven_group=tk.estecka.shiftingwares archives_base_name=shifting-wares diff --git a/src/main/java/tk/estecka/shiftingwares/IVillagerEntityDuck.java b/src/main/java/tk/estecka/shiftingwares/IVillagerEntityDuck.java index d5f29a0..499fb7d 100644 --- a/src/main/java/tk/estecka/shiftingwares/IVillagerEntityDuck.java +++ b/src/main/java/tk/estecka/shiftingwares/IVillagerEntityDuck.java @@ -2,12 +2,9 @@ import java.util.Optional; import net.minecraft.item.ItemStack; -import net.minecraft.village.TradeOfferList; public interface IVillagerEntityDuck { - TradeOfferList getOffers(); - Optional GetCachedMap(String key); void AddCachedMap(String key, ItemStack mapItem); } diff --git a/src/main/java/tk/estecka/shiftingwares/MapTradesCache.java b/src/main/java/tk/estecka/shiftingwares/MapTradesCache.java index d40c33a..6a278a4 100644 --- a/src/main/java/tk/estecka/shiftingwares/MapTradesCache.java +++ b/src/main/java/tk/estecka/shiftingwares/MapTradesCache.java @@ -1,6 +1,7 @@ package tk.estecka.shiftingwares; import java.util.Map; +import net.minecraft.entity.passive.VillagerEntity; import net.minecraft.item.FilledMapItem; import net.minecraft.item.ItemStack; import net.minecraft.item.Items; @@ -13,7 +14,8 @@ public class MapTradesCache { static public final String MAPID_CACHE = "shifting-wares:created_maps"; - static public void FillCacheFromTrades(IVillagerEntityDuck villager){ + static public void FillCacheFromTrades(VillagerEntity villager){ + IVillagerEntityDuck villagerMixin = (IVillagerEntityDuck)villager; TradeOfferList offers = villager.getOffers(); for (int i=0; i