Changed biome scrolls to biome essence, made it spawn in various structures

This commit is contained in:
Adubbz 2014-01-27 20:55:05 +11:00
parent ffe8f4aefc
commit 9cfd40dadf
7 changed files with 75 additions and 29 deletions

View File

@ -8,7 +8,7 @@ import biomesoplenty.api.BOPBlockHelper;
import biomesoplenty.api.BOPItemHelper;
import biomesoplenty.common.items.ItemBOPAncientStaff;
import biomesoplenty.common.items.ItemBOPAxe;
import biomesoplenty.common.items.ItemBOPBiomeScroll;
import biomesoplenty.common.items.ItemBOPBiomeEssence;
import biomesoplenty.common.items.ItemBOPFood;
import biomesoplenty.common.items.ItemBOPHoe;
import biomesoplenty.common.items.ItemBOPMisc;
@ -69,7 +69,7 @@ public class BOPItems
//registerItem(new ItemBiomeBook().setUnlocalizedName("biomeBook"));
registerItem(new ItemBiomeFinder().setUnlocalizedName("biomeFinder"));
registerItem(new ItemBOPBiomeScroll().setUnlocalizedName("biomeScroll"));
registerItem(new ItemBOPBiomeEssence().setUnlocalizedName("biomeEssence"));
registerItem(new ItemBOPSword(BOPItemHelper.toolMaterialMud, 0).setUnlocalizedName("swordMud"));
registerItem(new ItemBOPSpade(BOPItemHelper.toolMaterialMud, 0).setUnlocalizedName("shovelMud"));

View File

@ -2,9 +2,11 @@ package biomesoplenty.common.core;
import java.util.HashMap;
import java.util.Map.Entry;
import java.util.Random;
import net.minecraft.block.BlockDispenser;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.WeightedRandomChestContent;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraftforge.common.ChestGenHooks;
@ -20,6 +22,8 @@ import biomesoplenty.common.world.features.WorldGenBOPFlora;
public class BOPVanillaCompat
{
private static Random random = new Random();
public static void init()
{
registerDispenserBehaviours();
@ -61,6 +65,32 @@ public class BOPVanillaCompat
village.addItem(new WeightedRandomChestContent(new ItemStack(BOPItemHelper.get("misc"), 1, 1), 2, 8, 25));
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));
ItemStack biomeEssence = new ItemStack(BOPItemHelper.get("biomeEssence"));
biomeEssence.setTagCompound(new NBTTagCompound());
BiomeGenBase essenceBiome = null;
while (essenceBiome == null)
{
BiomeGenBase tempBiome = BiomeGenBase.func_150568_d(random.nextInt(BiomeGenBase.func_150565_n().length - 1));
if (tempBiome != null)
{
essenceBiome = tempBiome;
}
}
biomeEssence.getTagCompound().setString("biome", essenceBiome.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));
strongholdLibrary.addItem(new WeightedRandomChestContent(biomeEssence, 1, 1, 3));
}
}

View File

@ -0,0 +1,42 @@
package biomesoplenty.common.items;
import java.util.List;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.enchantment.Enchantment;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagList;
import biomesoplenty.BiomesOPlenty;
public class ItemBOPBiomeEssence extends Item
{
public ItemBOPBiomeEssence()
{
this.setCreativeTab(BiomesOPlenty.tabBiomesOPlenty);
}
@Override
public void registerIcons(IIconRegister iconRegister)
{
itemIcon = iconRegister.registerIcon("biomesoplenty:biomeessence");
}
@Override
public void addInformation(ItemStack itemStack, EntityPlayer player, List infoList, boolean advancedItemTooltips)
{
if (itemStack.hasTagCompound())
{
if (itemStack.getTagCompound().hasKey("biome")) infoList.add(itemStack.getTagCompound().getString("biome"));
}
}
@Override
public boolean hasEffect(ItemStack itemStack, int pass)
{
return true;
}
}

View File

@ -1,26 +0,0 @@
package biomesoplenty.common.items;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import biomesoplenty.BiomesOPlenty;
public class ItemBOPBiomeScroll extends Item
{
public ItemBOPBiomeScroll()
{
this.setCreativeTab(BiomesOPlenty.tabBiomesOPlenty);
}
@Override
public void registerIcons(IIconRegister iconRegister)
{
itemIcon = iconRegister.registerIcon("biomesoplenty:biomescroll");
}
@Override
public boolean hasEffect(ItemStack itemStack, int pass)
{
return true;
}
}

View File

@ -389,7 +389,7 @@ item.flippers.name=Flippers
item.biomeBook.name=Book O' Biomes
item.biomeFinder.name=Biome Radar
item.biomeScroll.name=Biome Scroll
item.biomeEssence.name=Biome Essence
item.bopBucket.amethyst_empty.name=Amethyst Bucket
item.bopBucket.amethyst_spring_water.name=Spring Water Amethyst Bucket

Binary file not shown.

After

Width:  |  Height:  |  Size: 246 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 287 B