Added berries (Food item). Finished up berry bushes.

This commit is contained in:
Matt Caughey 2013-05-16 12:47:57 -04:00
parent 7f38e7d047
commit 2b887abc5e
22 changed files with 78 additions and 6 deletions

View File

@ -33,6 +33,7 @@ public class Items
public static Optional<? extends Item> enderporter = Optional.absent();
public static Optional<? extends Item> shroomPowder = Optional.absent();
public static Optional<? extends Item> sunflowerSeeds = Optional.absent();
public static Optional<? extends Item> berries = Optional.absent();
public static Optional<? extends Item> miscItems = Optional.absent();
public static Optional<? extends Item> mudball = Optional.absent();
public static Optional<? extends Item> poison = Optional.absent();

View File

@ -176,6 +176,7 @@ public class BiomeDecoratorBOP extends BiomeDecorator
protected WorldGenerator potatoGen;
protected WorldGenerator sproutGen;
protected WorldGenerator bushGen;
protected WorldGenerator berryBushGen;
protected WorldGenerator tinyCactusGen;
protected WorldGenerator aloeGen;
protected WorldGenerator deathbloomGen;
@ -252,6 +253,7 @@ public class BiomeDecoratorBOP extends BiomeDecorator
protected int glowshroomsPerChunk;
protected int sproutsPerChunk;
protected int bushesPerChunk;
protected int berryBushesPerChunk;
protected int tinyCactiPerChunk;
protected int aloePerChunk;
protected int deathbloomsPerChunk;
@ -390,6 +392,7 @@ public class BiomeDecoratorBOP extends BiomeDecorator
this.plantDesertGen = new WorldGenBOPFlowers(Blocks.plants.get().blockID, 1);
this.thornGen = new WorldGenBOPFlowers(Blocks.plants.get().blockID, 5);
this.bushGen = new WorldGenBush(Blocks.foliage.get().blockID, 4);
this.berryBushGen = new WorldGenBOPFlowers(Blocks.foliage.get().blockID, 8);
this.tinyCactusGen = new WorldGenBOPFlowers(Blocks.flowers.get().blockID, 11);
this.aloeGen = new WorldGenBOPFlowers(Blocks.flowers.get().blockID, 12);
this.lilyflowerGen = new WorldGenLilyflower();
@ -471,6 +474,7 @@ public class BiomeDecoratorBOP extends BiomeDecorator
this.sunflowersPerChunk = 0;
this.sproutsPerChunk = 0;
this.bushesPerChunk = 0;
this.berryBushesPerChunk = 0;
this.tinyCactiPerChunk = 0;
this.poisonIvyPerChunk = 0;
this.aloePerChunk = 0;
@ -897,6 +901,14 @@ public class BiomeDecoratorBOP extends BiomeDecorator
this.bushGen.generate(this.currentWorld, this.randomGenerator, var3, var4, var5);
}
for (var2 = 0; var2 < this.berryBushesPerChunk; ++var2)
{
var3 = this.chunk_X + this.randomGenerator.nextInt(16) + 8;
var4 = this.randomGenerator.nextInt(128);
var5 = this.chunk_Z + this.randomGenerator.nextInt(16) + 8;
this.berryBushGen.generate(this.currentWorld, this.randomGenerator, var3, var4, var5);
}
for (var2 = 0; var2 < this.poisonIvyPerChunk; ++var2)
{
var3 = this.chunk_X + this.randomGenerator.nextInt(16) + 8;

View File

@ -27,6 +27,7 @@ public class BiomeGenChaparral extends BiomeGenBase
this.customBiomeDecorator.treesPerChunk = 8;
this.customBiomeDecorator.grassPerChunk = 20;
this.customBiomeDecorator.bushesPerChunk = 10;
this.customBiomeDecorator.berryBushesPerChunk = 2;
this.customBiomeDecorator.generateStoneInGrass = true;
this.customBiomeDecorator.generatePumpkins = false;
}

View File

@ -33,6 +33,7 @@ public class BiomeGenConiferousForest extends BiomeGenBase
this.customBiomeDecorator.violetsPerChunk = 2;
this.customBiomeDecorator.blueMilksPerChunk = 1;
this.customBiomeDecorator.poisonIvyPerChunk = 1;
this.customBiomeDecorator.berryBushesPerChunk = 1;
}
/**

View File

@ -26,6 +26,7 @@ public class BiomeGenDeciduousForest extends BiomeGenBase
this.customBiomeDecorator.flowersPerChunk = -999;
this.customBiomeDecorator.toadstoolsPerChunk = 1;
this.customBiomeDecorator.bushesPerChunk = 8;
this.customBiomeDecorator.berryBushesPerChunk = 2;
this.customBiomeDecorator.blueMilksPerChunk = 2;
this.customBiomeDecorator.poisonIvyPerChunk = 1;
}

View File

@ -28,6 +28,7 @@ public class BiomeGenForestNew extends BiomeGenBase
this.customBiomeDecorator.reedsBOPPerChunk = 5;
this.customBiomeDecorator.poisonIvyPerChunk = 2;
this.customBiomeDecorator.sunflowersPerChunk = 1;
this.customBiomeDecorator.berryBushesPerChunk = 2;
}
/**

View File

@ -21,6 +21,7 @@ public class BiomeGenGrove extends BiomeGenBase
this.customBiomeDecorator.sproutsPerChunk = 2;
this.customBiomeDecorator.poisonIvyPerChunk = 2;
this.customBiomeDecorator.lilyflowersPerChunk = 3;
this.customBiomeDecorator.berryBushesPerChunk = 2;
this.customBiomeDecorator.generatePumpkins = false;
}

View File

@ -22,6 +22,7 @@ public class BiomeGenHeathland extends BiomeGenBase
this.customBiomeDecorator.grassPerChunk = 10;
this.customBiomeDecorator.purpleFlowersPerChunk = 30;
this.customBiomeDecorator.deadBushPerChunk = 2;
this.customBiomeDecorator.berryBushesPerChunk = 1;
this.customBiomeDecorator.generatePumpkins = false;
}

View File

@ -19,6 +19,7 @@ public class BiomeGenMountain extends BiomeGenBase
this.customBiomeDecorator = (BiomeDecoratorBOP)theBiomeDecorator;
this.customBiomeDecorator.treesPerChunk = 2;
this.customBiomeDecorator.grassPerChunk = 3;
this.customBiomeDecorator.berryBushesPerChunk = 3;
}
/**

View File

@ -24,6 +24,7 @@ public class BiomeGenOrchard extends BiomeGenBase
this.customBiomeDecorator.portobellosPerChunk = 2;
this.customBiomeDecorator.sunflowersPerChunk = 1;
this.customBiomeDecorator.lilyflowersPerChunk = 2;
this.customBiomeDecorator.berryBushesPerChunk = 3;
}
/**

View File

@ -25,6 +25,7 @@ public class BiomeGenPrairie extends BiomeGenBase
this.customBiomeDecorator.grassPerChunk = 999;
this.customBiomeDecorator.whiteFlowersPerChunk = 45;
this.customBiomeDecorator.portobellosPerChunk = 2;
this.customBiomeDecorator.berryBushesPerChunk = 2;
}
/**

View File

@ -23,6 +23,7 @@ public class BiomeGenRedwoodForest extends BiomeGenBase
this.customBiomeDecorator.treesPerChunk = 6;
this.customBiomeDecorator.grassPerChunk = 16;
this.customBiomeDecorator.bushesPerChunk = 4;
this.customBiomeDecorator.berryBushesPerChunk = 1;
this.customBiomeDecorator.generatePumpkins = false;
}

View File

@ -25,6 +25,7 @@ public class BiomeGenSpruceWoods extends BiomeGenBase
this.customBiomeDecorator.grassPerChunk = 6;
this.customBiomeDecorator.sproutsPerChunk = 3;
this.customBiomeDecorator.poisonIvyPerChunk = 1;
this.customBiomeDecorator.berryBushesPerChunk = 3;
}
/**

View File

@ -42,6 +42,7 @@ public class BiomeGenWetland extends BiomeGenBase
this.customBiomeDecorator.blueFlowersPerChunk = 6;
this.customBiomeDecorator.blueMilksPerChunk = 1;
this.customBiomeDecorator.portobellosPerChunk = 1;
this.customBiomeDecorator.berryBushesPerChunk = 1;
this.spawnableCreatureList.clear();
this.spawnableWaterCreatureList.clear();
this.spawnableMonsterList.add(new SpawnListEntry(EntitySlime.class, 10, 1, 3));

View File

@ -272,11 +272,11 @@ public class BlockBOPAppleLeaves extends BlockLeavesBase implements IShearable
if ((meta & 3) == 3)
this.dropBlockAsItem_do(world, x, y, z, new ItemStack(Item.appleRed, 1, 0));
else if ((meta & 3) == 2 && world.rand.nextInt(2) == 0)
else if ((meta & 3) == 2 && world.rand.nextInt(8) == 0)
this.dropBlockAsItem_do(world, x, y, z, new ItemStack(Item.appleRed, 1, 0));
else if ((meta & 3) == 1 && world.rand.nextInt(5) == 0)
else if ((meta & 3) == 1 && world.rand.nextInt(16) == 0)
this.dropBlockAsItem_do(world, x, y, z, new ItemStack(Item.appleRed, 1, 0));
else if ((meta & 3) == 0 && world.rand.nextInt(10) == 0)
else if ((meta & 3) == 0 && world.rand.nextInt(32) == 0)
this.dropBlockAsItem_do(world, x, y, z, new ItemStack(Item.appleRed, 1, 0));
}

View File

@ -10,6 +10,7 @@ import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
@ -25,6 +26,7 @@ import net.minecraftforge.common.ForgeHooks;
import net.minecraftforge.common.IShearable;
import biomesoplenty.BiomesOPlenty;
import biomesoplenty.api.Blocks;
import biomesoplenty.api.Items;
import biomesoplenty.blocks.renderers.FoliageRenderer;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@ -73,7 +75,7 @@ public class BlockBOPFoliage extends BlockFlower implements IShearable
public void getSubBlocks(int blockID, CreativeTabs par2CreativeTabs, List list)
{
for (int i = 0; i < foliageTypes.length; ++i)
if (i != GRASSTOP && i != 8)
if (i != GRASSTOP)
list.add(new ItemStack(blockID, 1, i));
}
@ -239,6 +241,25 @@ public class BlockBOPFoliage extends BlockFlower implements IShearable
{
super.harvestBlock(world, player, x, y, z, meta);
}
@Override
public boolean onBlockActivated (World world, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9)
{
if (world.isRemote)
return false;
int meta = world.getBlockMetadata(x, y, z);
if (meta == 8)
{
world.setBlock(x, y, z, blockID, 4, 3);
EntityItem entityitem = new EntityItem(world, player.posX, player.posY - 1.0D, player.posZ, new ItemStack(Items.berries.get(), 1, 0));
world.spawnEntityInWorld(entityitem);
entityitem.onCollideWithPlayer(player);
return true;
}
else
return false;
}
@Override
public boolean isBlockReplaceable(World world, int x, int y, int z)

View File

@ -185,6 +185,7 @@ public class BOPConfiguration {
//Item IDs
public static int shroomPowderID;
public static int sunflowerSeedsID;
public static int berriesID;
public static int ancientStaffID;
public static int enderporterID;
@ -673,6 +674,7 @@ public class BOPConfiguration {
// Get Item ID's
shroomPowderID = config.getItem("Shroom Powder ID", 21001, null).getInt();
sunflowerSeedsID = config.getItem("Sunflower Seeds ID", 21002, null).getInt();
berriesID = config.getItem("Berries ID", 21003, null).getInt();
ancientStaffID = config.getItem("Ancient Staff ID", 21006).getInt();
enderporterID = config.getItem("Enderporter ID", 21007).getInt();

View File

@ -15,6 +15,7 @@ import biomesoplenty.api.Items;
import biomesoplenty.armor.ArmorAmethyst;
import biomesoplenty.armor.ArmorFlowerBand;
import biomesoplenty.armor.ArmorMuddy;
import biomesoplenty.items.ItemBerries;
import biomesoplenty.items.ItemBOP;
import biomesoplenty.items.ItemBOPAncientStaff;
import biomesoplenty.items.ItemBOPAxe;
@ -106,8 +107,9 @@ public class BOPItems {
private static void initializeItems()
{
// Item declaration
Items.shroomPowder = Optional.of(new ItemShroomPowder(BOPConfiguration.shroomPowderID, 1, 0.5F, false));
Items.sunflowerSeeds = Optional.of(new ItemSunflowerSeeds(BOPConfiguration.sunflowerSeedsID, 1, 1.5F, false));
Items.shroomPowder = Optional.of(new ItemShroomPowder(BOPConfiguration.shroomPowderID, 1, 0.1F, false));
Items.sunflowerSeeds = Optional.of(new ItemSunflowerSeeds(BOPConfiguration.sunflowerSeedsID, 2, 0.5F, false));
Items.berries = Optional.of(new ItemBerries(BOPConfiguration.berriesID, 3, 0.2F, false));
Items.miscItems = Optional.of(new ItemBOP(BOPConfiguration.miscItemsID));
Items.mudball = Optional.of(new ItemBOPMudball(BOPConfiguration.mudballID));
Items.dartBlower = Optional.of(new ItemDartBlower(BOPConfiguration.dartBlowerID));
@ -147,6 +149,7 @@ public class BOPItems {
{
LanguageRegistry.addName(Items.shroomPowder.get(), "Shroom Powder");
LanguageRegistry.addName(Items.sunflowerSeeds.get(), "Sunflower Seeds");
LanguageRegistry.addName(Items.berries.get(), "Berries");
LanguageRegistry.addName(Items.mudball.get(), "Mud Ball");
LanguageRegistry.addName(Items.dartBlower.get(), "Dart Blower");
LanguageRegistry.addName(new ItemStack(Items.dart.get(), 1, 0), "Dart");

View File

@ -0,0 +1,21 @@
package biomesoplenty.items;
import biomesoplenty.BiomesOPlenty;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.item.ItemFood;
import net.minecraft.potion.Potion;
public class ItemBerries extends ItemFood
{
public ItemBerries(int par1, int par2, float par3, boolean par4)
{
super(par1, par2, par3, par4);
setAlwaysEdible().setUnlocalizedName("berries");
setCreativeTab(BiomesOPlenty.tabBiomesOPlenty);
}
public void registerIcons(IconRegister iconRegister)
{
itemIcon = iconRegister.registerIcon("BiomesOPlenty:berries");
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 631 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 630 B

After

Width:  |  Height:  |  Size: 629 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 321 B