From a6d8a578897ca8f4c9bf2b1b4bdb33078b156ff9 Mon Sep 17 00:00:00 2001 From: Matt Caughey Date: Mon, 27 Jan 2014 07:01:16 -0500 Subject: [PATCH 1/2] Tweaked biome essence loot weights --- .../common/core/BOPVanillaCompat.java | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/main/java/biomesoplenty/common/core/BOPVanillaCompat.java b/src/main/java/biomesoplenty/common/core/BOPVanillaCompat.java index e348bb7af..541ebc804 100644 --- a/src/main/java/biomesoplenty/common/core/BOPVanillaCompat.java +++ b/src/main/java/biomesoplenty/common/core/BOPVanillaCompat.java @@ -49,6 +49,7 @@ public class BOPVanillaCompat ChestGenHooks strongholdCrossing = ChestGenHooks.getInfo(ChestGenHooks.STRONGHOLD_CROSSING); ChestGenHooks strongholdLibrary = ChestGenHooks.getInfo(ChestGenHooks.STRONGHOLD_LIBRARY); ChestGenHooks village = ChestGenHooks.getInfo(ChestGenHooks.VILLAGE_BLACKSMITH); + ChestGenHooks bonusChest = ChestGenHooks.getInfo(ChestGenHooks.BONUS_CHEST); if (BOPConfigurationMisc.dungeonLoot == true) { @@ -66,6 +67,9 @@ public class BOPVanillaCompat village.addItem(new WeightedRandomChestContent(new ItemStack(BOPItemHelper.get("wadingBoots"), 1, 0), 1, 1, 5)); village.addItem(new WeightedRandomChestContent(new ItemStack(BOPItemHelper.get("flippers"), 1, 0), 1, 1, 5)); + bonusChest.addItem(new WeightedRandomChestContent(new ItemStack(BOPItemHelper.get("wadingBoots"), 1, 0), 1, 1, 5)); + bonusChest.addItem(new WeightedRandomChestContent(new ItemStack(BOPItemHelper.get("flippers"), 1, 0), 1, 1, 5)); + for (BiomeGenBase biome : BiomeGenBase.func_150565_n()) { if (biome != null) @@ -75,13 +79,14 @@ public class BOPVanillaCompat biomeEssence.setTagCompound(new NBTTagCompound()); biomeEssence.getTagCompound().setString("biome", biome.biomeName); - desertTemple.addItem(new WeightedRandomChestContent(biomeEssence, 1, 1, 3)); - dungeon.addItem(new WeightedRandomChestContent(biomeEssence, 1, 1, 3)); - jungleTemple.addItem(new WeightedRandomChestContent(biomeEssence, 1, 1, 3)); - mineshaft.addItem(new WeightedRandomChestContent(biomeEssence, 1, 1, 3)); - strongholdCorridor.addItem(new WeightedRandomChestContent(biomeEssence, 1, 1, 3)); - strongholdCrossing.addItem(new WeightedRandomChestContent(biomeEssence, 1, 1, 3)); + desertTemple.addItem(new WeightedRandomChestContent(biomeEssence, 1, 1, 1)); + dungeon.addItem(new WeightedRandomChestContent(biomeEssence, 1, 1, 1)); + jungleTemple.addItem(new WeightedRandomChestContent(biomeEssence, 1, 1, 2)); + mineshaft.addItem(new WeightedRandomChestContent(biomeEssence, 1, 1, 1)); + strongholdCorridor.addItem(new WeightedRandomChestContent(biomeEssence, 1, 1, 1)); + strongholdCrossing.addItem(new WeightedRandomChestContent(biomeEssence, 1, 1, 1)); strongholdLibrary.addItem(new WeightedRandomChestContent(biomeEssence, 1, 1, 3)); + bonusChest.addItem(new WeightedRandomChestContent(biomeEssence, 1, 1, 1)); } } } From 6ac4c0d0c5345afd21623214c1b35057d02a4d3f Mon Sep 17 00:00:00 2001 From: Matt Caughey Date: Mon, 27 Jan 2014 12:18:28 -0500 Subject: [PATCH 2/2] Added color support for biome essence --- .../common/core/BOPVanillaCompat.java | 1 + .../common/items/ItemBOPBiomeEssence.java | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/src/main/java/biomesoplenty/common/core/BOPVanillaCompat.java b/src/main/java/biomesoplenty/common/core/BOPVanillaCompat.java index 541ebc804..f28822233 100644 --- a/src/main/java/biomesoplenty/common/core/BOPVanillaCompat.java +++ b/src/main/java/biomesoplenty/common/core/BOPVanillaCompat.java @@ -78,6 +78,7 @@ public class BOPVanillaCompat biomeEssence.setTagCompound(new NBTTagCompound()); biomeEssence.getTagCompound().setString("biome", biome.biomeName); + biomeEssence.getTagCompound().setInteger("color", biome.color); desertTemple.addItem(new WeightedRandomChestContent(biomeEssence, 1, 1, 1)); dungeon.addItem(new WeightedRandomChestContent(biomeEssence, 1, 1, 1)); diff --git a/src/main/java/biomesoplenty/common/items/ItemBOPBiomeEssence.java b/src/main/java/biomesoplenty/common/items/ItemBOPBiomeEssence.java index 8794aac7d..36ffd7104 100644 --- a/src/main/java/biomesoplenty/common/items/ItemBOPBiomeEssence.java +++ b/src/main/java/biomesoplenty/common/items/ItemBOPBiomeEssence.java @@ -11,6 +11,7 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagList; import biomesoplenty.BiomesOPlenty; +import biomesoplenty.api.BOPBlockHelper; public class ItemBOPBiomeEssence extends Item { @@ -34,6 +35,21 @@ public class ItemBOPBiomeEssence extends Item } } + @Override + @SideOnly(Side.CLIENT) + public int getColorFromItemStack(ItemStack itemStack, int par2) + { + if (itemStack.hasTagCompound()) + { + if (itemStack.getTagCompound().hasKey("color")) + { + return itemStack.getTagCompound().getInteger("color"); + } + } + + return 16777215; + } + @Override public boolean hasEffect(ItemStack itemStack, int pass) {