diff --git a/src/main/java/com/zivilon/cinder_loe/CinderLoE.java b/src/main/java/com/zivilon/cinder_loe/CinderLoE.java index aaf6fc7..e3121e8 100644 --- a/src/main/java/com/zivilon/cinder_loe/CinderLoE.java +++ b/src/main/java/com/zivilon/cinder_loe/CinderLoE.java @@ -34,6 +34,7 @@ import com.zivilon.cinder_loe.entity.npc.radagast.*; import com.zivilon.cinder_loe.entity.projectile.*; import com.zivilon.cinder_loe.items.*; import com.zivilon.cinder_loe.items.specials.*; +import com.zivilon.cinder_loe.lotr.ChestContentsOverride; import com.zivilon.cinder_loe.network.*; import com.zivilon.cinder_loe.potion.LoEPotions; import com.zivilon.cinder_loe.tileentity.*; @@ -380,6 +381,7 @@ public class CinderLoE { registerItems(); ItemRegistration.registerItems(); registerEntities(); + ChestContentsOverride.replace_chest_contents(); modEventHandler = new CinderEventHandler(); CommonProxy proxy = event.getSide() == Side.CLIENT ? new ClientProxy() : new ServerProxy(); proxy.setup(); diff --git a/src/main/java/com/zivilon/cinder_loe/lotr/ChestContentsOverride.java b/src/main/java/com/zivilon/cinder_loe/lotr/ChestContentsOverride.java new file mode 100644 index 0000000..71d369a --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/lotr/ChestContentsOverride.java @@ -0,0 +1,77 @@ +package com.zivilon.cinder_loe.lotr; + +import lotr.common.world.structure.LOTRChestContents; +import net.minecraft.util.WeightedRandomChestContent; +import lotr.common.LOTRMod; +import com.zivilon.cinder_loe.CinderLoE; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import lotr.common.item.LOTRItemConquestHorn; +import lotr.common.world.spawning.LOTRInvasions; + +public class ChestContentsOverride { + public static void replace_chest_contents() { + change_pyramid_drops(); + } + + private static void change_pyramid_drops() { + LOTRChestContents.NEAR_HARAD_PYRAMID = new LOTRChestContents(8, 10, + new WeightedRandomChestContent[]{new WeightedRandomChestContent(new ItemStack(LOTRMod.helmetNearHarad), 1, 1, 5), + new WeightedRandomChestContent(new ItemStack(LOTRMod.bodyNearHarad), 1, 1, 5), + new WeightedRandomChestContent(new ItemStack(LOTRMod.legsNearHarad), 1, 1, 5), + new WeightedRandomChestContent(new ItemStack(LOTRMod.bootsNearHarad), 1, 1, 5), + new WeightedRandomChestContent(new ItemStack(LOTRMod.scimitarNearHarad), 1, 1, 25), + new WeightedRandomChestContent(new ItemStack(LOTRMod.daggerNearHarad), 1, 1, 5), + new WeightedRandomChestContent(new ItemStack(LOTRMod.spearNearHarad), 1, 1, 5), + new WeightedRandomChestContent(new ItemStack(LOTRMod.poleaxeNearHarad), 1, 1, 5), + new WeightedRandomChestContent(new ItemStack(LOTRMod.maceNearHarad), 1, 1, 5), + new WeightedRandomChestContent(new ItemStack(LOTRMod.pikeNearHarad), 1, 1, 5), + new WeightedRandomChestContent(new ItemStack(LOTRMod.helmetGulfHarad), 1, 1, 5), + new WeightedRandomChestContent(new ItemStack(LOTRMod.bodyGulfHarad), 1, 1, 5), + new WeightedRandomChestContent(new ItemStack(LOTRMod.legsGulfHarad), 1, 1, 5), + new WeightedRandomChestContent(new ItemStack(LOTRMod.bootsGulfHarad), 1, 1, 5), + new WeightedRandomChestContent(new ItemStack(LOTRMod.swordGulfHarad), 1, 1, 25), + new WeightedRandomChestContent(new ItemStack(LOTRMod.daggerHarad), 1, 1, 5), + new WeightedRandomChestContent(new ItemStack(LOTRMod.swordHarad), 1, 1, 5), + new WeightedRandomChestContent(new ItemStack(LOTRMod.spearHarad), 1, 1, 5), + new WeightedRandomChestContent(new ItemStack(LOTRMod.pikeHarad), 1, 1, 5), + new WeightedRandomChestContent(new ItemStack(LOTRMod.nearHaradBow), 1, 1, 25), + new WeightedRandomChestContent(new ItemStack(LOTRMod.silverCoin, 1, 0), 1, 40, 100), + new WeightedRandomChestContent(new ItemStack(LOTRMod.silverCoin, 1, 1), 1, 15, 25), + new WeightedRandomChestContent(new ItemStack(LOTRMod.silverCoin, 1, 2), 1, 2, 10), + new WeightedRandomChestContent(new ItemStack(Items.gold_ingot), 1, 8, 100), + new WeightedRandomChestContent(new ItemStack(LOTRMod.silver), 1, 8, 100), + new WeightedRandomChestContent(new ItemStack(LOTRMod.bronze), 1, 8, 100), + new WeightedRandomChestContent(new ItemStack(Items.iron_ingot), 1, 8, 100), + new WeightedRandomChestContent(new ItemStack(Items.dye, 1, 4), 1, 8, 50), + new WeightedRandomChestContent(new ItemStack(LOTRMod.mithrilNugget), 1, 3, 10), + new WeightedRandomChestContent(new ItemStack(LOTRMod.diamond), 1, 2, 10), + new WeightedRandomChestContent(new ItemStack(LOTRMod.emerald), 1, 3, 15), + new WeightedRandomChestContent(new ItemStack(LOTRMod.ruby), 1, 3, 20), + new WeightedRandomChestContent(new ItemStack(LOTRMod.sapphire), 1, 3, 20), + new WeightedRandomChestContent(new ItemStack(LOTRMod.topaz), 1, 4, 20), + new WeightedRandomChestContent(new ItemStack(LOTRMod.amber), 1, 4, 20), + new WeightedRandomChestContent(new ItemStack(LOTRMod.goldRing), 1, 2, 25), + new WeightedRandomChestContent(new ItemStack(LOTRMod.silverRing), 1, 2, 25), + new WeightedRandomChestContent(new ItemStack(Items.skull), 1, 1, 50), + new WeightedRandomChestContent(new ItemStack(Items.bone), 1, 3, 100), + new WeightedRandomChestContent(new ItemStack(Items.rotten_flesh), 1, 3, 100), + new WeightedRandomChestContent(LOTRItemConquestHorn.createHorn(LOTRInvasions.NEAR_HARAD_COAST), 1, 1, 1), + new WeightedRandomChestContent(LOTRItemConquestHorn.createHorn(LOTRInvasions.NEAR_HARAD_UMBAR), 1, 1, 1), + new WeightedRandomChestContent(LOTRItemConquestHorn.createHorn(LOTRInvasions.NEAR_HARAD_HARNEDOR), 1, 1, 1), + new WeightedRandomChestContent(LOTRItemConquestHorn.createHorn(LOTRInvasions.NEAR_HARAD_GULF), 1, 1, 1), + new WeightedRandomChestContent(LOTRItemConquestHorn.createHorn(LOTRInvasions.NEAR_HARAD_NOMAD), 1, 1, 1), + new WeightedRandomChestContent(new ItemStack(LOTRMod.daggerAncientHarad), 1, 1, 50), + new WeightedRandomChestContent(new ItemStack(LOTRMod.helmetBlackNumenorean), 1, 1, 20), + new WeightedRandomChestContent(new ItemStack(LOTRMod.bodyBlackNumenorean), 1, 1, 20), + new WeightedRandomChestContent(new ItemStack(LOTRMod.legsBlackNumenorean), 1, 1, 20), + new WeightedRandomChestContent(new ItemStack(LOTRMod.bootsBlackNumenorean), 1, 1, 20), + new WeightedRandomChestContent(new ItemStack(LOTRMod.swordBlackNumenorean), 1, 1, 20), + new WeightedRandomChestContent(new ItemStack(CinderLoE.greatswordNumenor), 1, 1, 20), + new WeightedRandomChestContent(new ItemStack(LOTRMod.daggerBlackNumenorean), 1, 1, 20), + new WeightedRandomChestContent(new ItemStack(LOTRMod.spearBlackNumenorean), 1, 1, 20), + new WeightedRandomChestContent(new ItemStack(LOTRMod.maceBlackNumenorean), 1, 1, 20)}); + System.out.println("Is greatsword null: " + (CinderLoE.greatswordNumenor == null)); + } + +} diff --git a/src/main/java/com/zivilon/cinder_loe/mixins/overrides/MixinLOTRChestContents.java b/src/main/java/com/zivilon/cinder_loe/mixins/overrides/MixinLOTRChestContents.java deleted file mode 100644 index a71af9c..0000000 --- a/src/main/java/com/zivilon/cinder_loe/mixins/overrides/MixinLOTRChestContents.java +++ /dev/null @@ -1,90 +0,0 @@ -package com.zivilon.cinder_loe.mixins.overrides; - -import com.zivilon.cinder_loe.CinderLoE; -import lotr.common.LOTRFoods; -import lotr.common.LOTRMod; -import lotr.common.item.LOTRItemConquestHorn; -import lotr.common.item.LOTRItemMug; -import lotr.common.world.spawning.LOTRInvasions; -import lotr.common.world.structure.LOTRChestContents; -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; -import net.minecraft.util.WeightedRandomChestContent; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Overwrite; -import org.spongepowered.asm.mixin.Shadow; - -@Mixin(LOTRChestContents.class) -public class MixinLOTRChestContents { - - @Shadow - public WeightedRandomChestContent[] items; - - @Shadow private LOTRItemMug.Vessel[] vesselTypes; - - @Shadow - public static LOTRChestContents NEAR_HARAD_PYRAMID = - new LOTRChestContents(8, 10, - new WeightedRandomChestContent[]{new WeightedRandomChestContent(new ItemStack(LOTRMod.helmetNearHarad), 1, 1, 5), - new WeightedRandomChestContent(new ItemStack(LOTRMod.bodyNearHarad), 1, 1, 5), - new WeightedRandomChestContent(new ItemStack(LOTRMod.legsNearHarad), 1, 1, 5), - new WeightedRandomChestContent(new ItemStack(LOTRMod.bootsNearHarad), 1, 1, 5), - new WeightedRandomChestContent(new ItemStack(LOTRMod.scimitarNearHarad), 1, 1, 25), - new WeightedRandomChestContent(new ItemStack(LOTRMod.daggerNearHarad), 1, 1, 5), - new WeightedRandomChestContent(new ItemStack(LOTRMod.spearNearHarad), 1, 1, 5), - new WeightedRandomChestContent(new ItemStack(LOTRMod.poleaxeNearHarad), 1, 1, 5), - new WeightedRandomChestContent(new ItemStack(LOTRMod.maceNearHarad), 1, 1, 5), - new WeightedRandomChestContent(new ItemStack(LOTRMod.pikeNearHarad), 1, 1, 5), - new WeightedRandomChestContent(new ItemStack(LOTRMod.helmetGulfHarad), 1, 1, 5), - new WeightedRandomChestContent(new ItemStack(LOTRMod.bodyGulfHarad), 1, 1, 5), - new WeightedRandomChestContent(new ItemStack(LOTRMod.legsGulfHarad), 1, 1, 5), - new WeightedRandomChestContent(new ItemStack(LOTRMod.bootsGulfHarad), 1, 1, 5), - new WeightedRandomChestContent(new ItemStack(LOTRMod.swordGulfHarad), 1, 1, 25), - new WeightedRandomChestContent(new ItemStack(LOTRMod.daggerHarad), 1, 1, 5), - new WeightedRandomChestContent(new ItemStack(LOTRMod.swordHarad), 1, 1, 5), - new WeightedRandomChestContent(new ItemStack(LOTRMod.spearHarad), 1, 1, 5), - new WeightedRandomChestContent(new ItemStack(LOTRMod.pikeHarad), 1, 1, 5), - new WeightedRandomChestContent(new ItemStack(LOTRMod.nearHaradBow), 1, 1, 25), - new WeightedRandomChestContent(new ItemStack(LOTRMod.silverCoin, 1, 0), 1, 40, 100), - new WeightedRandomChestContent(new ItemStack(LOTRMod.silverCoin, 1, 1), 1, 15, 25), - new WeightedRandomChestContent(new ItemStack(LOTRMod.silverCoin, 1, 2), 1, 2, 10), - new WeightedRandomChestContent(new ItemStack(Items.gold_ingot), 1, 8, 100), - new WeightedRandomChestContent(new ItemStack(LOTRMod.silver), 1, 8, 100), - new WeightedRandomChestContent(new ItemStack(LOTRMod.bronze), 1, 8, 100), - new WeightedRandomChestContent(new ItemStack(Items.iron_ingot), 1, 8, 100), - new WeightedRandomChestContent(new ItemStack(Items.dye, 1, 4), 1, 8, 50), - new WeightedRandomChestContent(new ItemStack(LOTRMod.mithrilNugget), 1, 3, 10), - new WeightedRandomChestContent(new ItemStack(LOTRMod.diamond), 1, 2, 10), - new WeightedRandomChestContent(new ItemStack(LOTRMod.emerald), 1, 3, 15), - new WeightedRandomChestContent(new ItemStack(LOTRMod.ruby), 1, 3, 20), - new WeightedRandomChestContent(new ItemStack(LOTRMod.sapphire), 1, 3, 20), - new WeightedRandomChestContent(new ItemStack(LOTRMod.topaz), 1, 4, 20), - new WeightedRandomChestContent(new ItemStack(LOTRMod.amber), 1, 4, 20), - new WeightedRandomChestContent(new ItemStack(LOTRMod.goldRing), 1, 2, 25), - new WeightedRandomChestContent(new ItemStack(LOTRMod.silverRing), 1, 2, 25), - new WeightedRandomChestContent(new ItemStack(Items.skull), 1, 1, 50), - new WeightedRandomChestContent(new ItemStack(Items.bone), 1, 3, 100), - new WeightedRandomChestContent(new ItemStack(Items.rotten_flesh), 1, 3, 100), - new WeightedRandomChestContent(LOTRItemConquestHorn.createHorn(LOTRInvasions.NEAR_HARAD_COAST), 1, 1, 1), - new WeightedRandomChestContent(LOTRItemConquestHorn.createHorn(LOTRInvasions.NEAR_HARAD_UMBAR), 1, 1, 1), - new WeightedRandomChestContent(LOTRItemConquestHorn.createHorn(LOTRInvasions.NEAR_HARAD_HARNEDOR), 1, 1, 1), - new WeightedRandomChestContent(LOTRItemConquestHorn.createHorn(LOTRInvasions.NEAR_HARAD_GULF), 1, 1, 1), - new WeightedRandomChestContent(LOTRItemConquestHorn.createHorn(LOTRInvasions.NEAR_HARAD_NOMAD), 1, 1, 1), - new WeightedRandomChestContent(new ItemStack(LOTRMod.daggerAncientHarad), 1, 1, 50), - new WeightedRandomChestContent(new ItemStack(LOTRMod.helmetBlackNumenorean), 1, 1, 20), - new WeightedRandomChestContent(new ItemStack(LOTRMod.bodyBlackNumenorean), 1, 1, 20), - new WeightedRandomChestContent(new ItemStack(LOTRMod.legsBlackNumenorean), 1, 1, 20), - new WeightedRandomChestContent(new ItemStack(LOTRMod.bootsBlackNumenorean), 1, 1, 20), - new WeightedRandomChestContent(new ItemStack(LOTRMod.swordBlackNumenorean), 1, 1, 20), - new WeightedRandomChestContent(new ItemStack(CinderLoE.greatswordNumenor), 1, 1, 20), - new WeightedRandomChestContent(new ItemStack(LOTRMod.daggerBlackNumenorean), 1, 1, 20), - new WeightedRandomChestContent(new ItemStack(LOTRMod.spearBlackNumenorean), 1, 1, 20), - new WeightedRandomChestContent(new ItemStack(LOTRMod.maceBlackNumenorean), 1, 1, 20)}); - - private MixinLOTRChestContents setDrinkVessels(LOTRItemMug.Vessel ... v) { - this.vesselTypes = v; - return this; - } - - -}