From f152741bba21ebf30dfa319f62fa442885b989bc Mon Sep 17 00:00:00 2001 From: Tmtravlr Date: Thu, 26 Feb 2015 14:25:41 -0700 Subject: [PATCH] Added Nether Fortress chest to the ChestGenHooks I tried to follow the directions on https://github.com/MinecraftForge/MinecraftForge/wiki/If-you-want-to-contribute-to-Forge as best as I could. =) If anything is wrong, let me know and I'll change it! --- .../StructureNetherBridgePieces.java.patch | 28 +++++++++++++++++++ .../minecraftforge/common/ChestGenHooks.java | 1 + 2 files changed, 29 insertions(+) create mode 100644 patches/minecraft/net/minecraft/world/gen/structure/StructureNetherBridgePieces.java.patch diff --git a/patches/minecraft/net/minecraft/world/gen/structure/StructureNetherBridgePieces.java.patch b/patches/minecraft/net/minecraft/world/gen/structure/StructureNetherBridgePieces.java.patch new file mode 100644 index 000000000..fbe1b5d05 --- /dev/null +++ b/patches/minecraft/net/minecraft/world/gen/structure/StructureNetherBridgePieces.java.patch @@ -0,0 +1,28 @@ +--- ../src-base/minecraft/net/minecraft/world/gen/structure/StructureNetherBridgePieces.java ++++ ../src-work/minecraft/net/minecraft/world/gen/structure/StructureNetherBridgePieces.java +@@ -154,7 +154,7 @@ + if (this.field_111021_b && p_74875_3_.func_175898_b(new BlockPos(this.func_74865_a(3, 3), this.func_74862_a(2), this.func_74873_b(3, 3)))) + { + this.field_111021_b = false; +- this.func_180778_a(p_74875_1_, p_74875_3_, p_74875_2_, 3, 2, 3, field_111019_a, 2 + p_74875_2_.nextInt(4)); ++ this.func_180778_a(p_74875_1_, p_74875_3_, p_74875_2_, 3, 2, 3, net.minecraftforge.common.ChestGenHooks.getItems(net.minecraftforge.common.ChestGenHooks.NETHER_FORTRESS, p_74875_2_), net.minecraftforge.common.ChestGenHooks.getCount(net.minecraftforge.common.ChestGenHooks.NETHER_FORTRESS, p_74875_2_)); + } + + this.func_175804_a(p_74875_1_, p_74875_3_, 0, 6, 0, 4, 6, 4, Blocks.field_150385_bj.func_176223_P(), Blocks.field_150385_bj.func_176223_P(), false); +@@ -224,7 +224,7 @@ + if (this.field_111020_b && p_74875_3_.func_175898_b(new BlockPos(this.func_74865_a(1, 3), this.func_74862_a(2), this.func_74873_b(1, 3)))) + { + this.field_111020_b = false; +- this.func_180778_a(p_74875_1_, p_74875_3_, p_74875_2_, 1, 2, 3, field_111019_a, 2 + p_74875_2_.nextInt(4)); ++ this.func_180778_a(p_74875_1_, p_74875_3_, p_74875_2_, 1, 2, 3, net.minecraftforge.common.ChestGenHooks.getItems(net.minecraftforge.common.ChestGenHooks.NETHER_FORTRESS, p_74875_2_), net.minecraftforge.common.ChestGenHooks.getCount(net.minecraftforge.common.ChestGenHooks.NETHER_FORTRESS, p_74875_2_)); + } + + this.func_175804_a(p_74875_1_, p_74875_3_, 0, 6, 0, 4, 6, 4, Blocks.field_150385_bj.func_176223_P(), Blocks.field_150385_bj.func_176223_P(), false); +@@ -953,6 +953,7 @@ + abstract static class Piece extends StructureComponent + { + protected static final List field_111019_a = Lists.newArrayList(new WeightedRandomChestContent[] {new WeightedRandomChestContent(Items.field_151045_i, 0, 1, 3, 5), new WeightedRandomChestContent(Items.field_151042_j, 0, 1, 5, 5), new WeightedRandomChestContent(Items.field_151043_k, 0, 1, 3, 15), new WeightedRandomChestContent(Items.field_151010_B, 0, 1, 1, 5), new WeightedRandomChestContent(Items.field_151171_ah, 0, 1, 1, 5), new WeightedRandomChestContent(Items.field_151033_d, 0, 1, 1, 5), new WeightedRandomChestContent(Items.field_151075_bm, 0, 3, 7, 5), new WeightedRandomChestContent(Items.field_151141_av, 0, 1, 1, 10), new WeightedRandomChestContent(Items.field_151136_bY, 0, 1, 1, 8), new WeightedRandomChestContent(Items.field_151138_bX, 0, 1, 1, 5), new WeightedRandomChestContent(Items.field_151125_bZ, 0, 1, 1, 3), new WeightedRandomChestContent(Item.func_150898_a(Blocks.field_150343_Z), 0, 2, 4, 2)}); ++ static { net.minecraftforge.common.ChestGenHooks.init(net.minecraftforge.common.ChestGenHooks.NETHER_FORTRESS, field_111019_a, 2, 5); } + private static final String __OBFID = "CL_00000466"; + + public Piece() {} diff --git a/src/main/java/net/minecraftforge/common/ChestGenHooks.java b/src/main/java/net/minecraftforge/common/ChestGenHooks.java index b6747a2ea..37299e74d 100644 --- a/src/main/java/net/minecraftforge/common/ChestGenHooks.java +++ b/src/main/java/net/minecraftforge/common/ChestGenHooks.java @@ -31,6 +31,7 @@ public class ChestGenHooks public static final String VILLAGE_BLACKSMITH = "villageBlacksmith"; public static final String BONUS_CHEST = "bonusChest"; public static final String DUNGEON_CHEST = "dungeonChest"; + public static final String NETHER_FORTRESS = "netherFortress"; private static final HashMap chestInfo = new HashMap(); private static boolean hasInit = false;