From 2b61ea417b3888a87a17a014f5040d6604170cd9 Mon Sep 17 00:00:00 2001 From: LexManos Date: Tue, 2 Jul 2013 02:37:05 -0700 Subject: [PATCH] Update ChestGenHooks for new Dungeon chest strcture. --- common/forge_at.cfg | 1 + .../minecraftforge/common/ChestGenHooks.java | 22 +++---------------- .../gen/feature/WorldGenDungeons.java.patch | 9 ++++++-- 3 files changed, 11 insertions(+), 21 deletions(-) diff --git a/common/forge_at.cfg b/common/forge_at.cfg index f6e6029b1a..7063cee1a2 100644 --- a/common/forge_at.cfg +++ b/common/forge_at.cfg @@ -84,6 +84,7 @@ public ahr.a #FD:ComponentStrongholdChestCorridor/field_75003_a #strongholdChest public ahv.b #FD:ComponentStrongholdLibrary/field_75007_b #strongholdLibraryChestContents public aia.c #FD:ComponentStrongholdRoomCrossing/field_75014_c #strongholdCorridorChestContents public ajb.a #FD:ComponentVillageHouse2/field_74918_a #villageBlacksmithChestContents +public afk.a #FD:WorldGenDungeons/field_111189_a #chestContents # AnvilChunkLoader.chunkSaveLocation public adz.d #FD:AnvilChunkLoader/field_75825_d # ChunkProviderServer.currentChunkLoader diff --git a/common/net/minecraftforge/common/ChestGenHooks.java b/common/net/minecraftforge/common/ChestGenHooks.java index 7ce6d66549..68c326c442 100644 --- a/common/net/minecraftforge/common/ChestGenHooks.java +++ b/common/net/minecraftforge/common/ChestGenHooks.java @@ -7,6 +7,7 @@ import net.minecraft.item.ItemStack; import net.minecraft.util.WeightedRandom; import net.minecraft.util.WeightedRandomChestContent; import net.minecraft.world.WorldServer; +import net.minecraft.world.gen.feature.WorldGenDungeons; import net.minecraft.world.gen.structure.*; import net.minecraftforge.oredict.OreDictionary; @@ -49,6 +50,7 @@ public class ChestGenHooks addInfo(STRONGHOLD_CROSSING, ComponentStrongholdRoomCrossing.strongholdRoomCrossingChestContents, 1, 5); addInfo(VILLAGE_BLACKSMITH, ComponentVillageHouse2.villageBlacksmithChestContents, 3, 9); addInfo(BONUS_CHEST, WorldServer.bonusChestContent, 10, 10); + addInfo(DUNGEON_CHEST, WorldGenDungeons.field_111189_a, 8, 8); ItemStack book = new ItemStack(Item.enchantedBook, 1, 0); WeightedRandomChestContent tmp = new WeightedRandomChestContent(book, 1, 1, 1); @@ -58,25 +60,7 @@ public class ChestGenHooks getInfo(STRONGHOLD_CORRIDOR ).addItem(tmp); getInfo(STRONGHOLD_LIBRARY ).addItem(new WeightedRandomChestContent(book, 1, 5, 2)); getInfo(STRONGHOLD_CROSSING ).addItem(tmp); - - //Wish Dungeons would get on the same wave length as other world gen... - ChestGenHooks d = new ChestGenHooks(DUNGEON_CHEST); - d.countMin = 8; - d.countMax = 8; - chestInfo.put(DUNGEON_CHEST, d); - addDungeonLoot(d, new ItemStack(Item.saddle), 100, 1, 1); - addDungeonLoot(d, new ItemStack(Item.ingotIron), 100, 1, 4); - addDungeonLoot(d, new ItemStack(Item.bread), 100, 1, 1); - addDungeonLoot(d, new ItemStack(Item.wheat), 100, 1, 4); - addDungeonLoot(d, new ItemStack(Item.gunpowder), 100, 1, 4); - addDungeonLoot(d, new ItemStack(Item.silk), 100, 1, 4); - addDungeonLoot(d, new ItemStack(Item.bucketEmpty), 100, 1, 1); - addDungeonLoot(d, new ItemStack(Item.appleGold), 1, 1, 1); - addDungeonLoot(d, new ItemStack(Item.redstone), 50, 1, 4); - addDungeonLoot(d, new ItemStack(Item.record13), 5, 1, 1); - addDungeonLoot(d, new ItemStack(Item.recordCat), 5, 1, 1); - addDungeonLoot(d, new ItemStack(Item.dyePowder, 1, 3), 100, 1, 1); - addDungeonLoot(d, book, 100, 1, 1); + getInfo(DUNGEON_CHEST ).addItem(tmp); } static void addDungeonLoot(ChestGenHooks dungeon, ItemStack item, int weight, int min, int max) diff --git a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenDungeons.java.patch b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenDungeons.java.patch index f1048e3a84..d9fe44071c 100644 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenDungeons.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenDungeons.java.patch @@ -9,7 +9,12 @@ public class WorldGenDungeons extends WorldGenerator { -@@ -127,7 +129,8 @@ +@@ -122,12 +124,12 @@ + if (k2 == 1) + { + par1World.setBlock(i2, par4, j2, Block.chest.blockID, 0, 2); +- WeightedRandomChestContent[] aweightedrandomchestcontent = WeightedRandomChestContent.func_92080_a(field_111189_a, new WeightedRandomChestContent[] {Item.enchantedBook.func_92114_b(par2Random)}); + TileEntityChest tileentitychest = (TileEntityChest)par1World.getBlockTileEntity(i2, par4, j2); if (tileentitychest != null) { @@ -19,7 +24,7 @@ } break label101; -@@ -169,7 +172,6 @@ +@@ -169,7 +171,6 @@ */ private String pickMobSpawner(Random par1Random) {