Work on dandelions. All that is left is for the particles to spawn properly at the player's face (Sometimes they spawn on the ground, and they don't go in the direction the player is facing). I think this calls for... Amnet!

This commit is contained in:
Adubbz 2013-05-14 17:19:58 +10:00
parent 67c4d276b8
commit e938cdbda6
3 changed files with 48 additions and 3 deletions

View File

@ -4,4 +4,5 @@
- Add Acacia trees from BWG4.
- Add cooked portobellos.
- Give waterlilies a proper render method and hitbox.
- Add sunflowers.
- Add sunflowers.
- Reduce excessive amounts of mobs in the Promised Lands.

View File

@ -1,8 +1,12 @@
package biomesoplenty.items;
import biomesoplenty.BiomesOPlenty;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumAction;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.util.Icon;
@ -37,6 +41,46 @@ public class ItemBOPFlower extends ItemBlock
return Block.blocksList[this.itemID].getIcon(0, meta);
}
@SideOnly(Side.CLIENT)
public boolean isFull3D()
{
return true;
}
@Override
public EnumAction getItemUseAction(ItemStack par1ItemStack)
{
if (par1ItemStack.getItemDamage() == 15)
return EnumAction.block;
else
return null;
}
@Override
public int getMaxItemUseDuration(ItemStack par1ItemStack)
{
return 72000;
}
@Override
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
{
if (par1ItemStack.getItemDamage() == 15) {
double x = par3EntityPlayer.posX;
double y = par3EntityPlayer.posY;
double z = par3EntityPlayer.posZ;
for (int p = 0; p < 20; ++p)
{
BiomesOPlenty.proxy.spawnParticle("dandelion", x, y, z);
};
par3EntityPlayer.setItemInUse(par1ItemStack, this.getMaxItemUseDuration(par1ItemStack));
}
return par1ItemStack;
}
@Override
public boolean onItemUse(ItemStack itemStack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ)
{
@ -64,7 +108,7 @@ public class ItemBOPFlower extends ItemBlock
if (side == 5)
++x;
}
if (!player.canPlayerEdit(x, y, z, side, itemStack))
{
return false;

View File

@ -231,7 +231,7 @@ public class EntityDart extends EntityArrow
for (int p = 0; i < 16; ++i)
{
BiomesOPlenty.proxy.spawnParticle("dandelion", this.posX, this.posY, this.posZ);
BiomesOPlenty.proxy.spawnParticle("dart", this.posX, this.posY, this.posZ);
}
this.playSound("random.bowhit", 1.0F, 1.2F / (this.rand.nextFloat() * 0.2F + 0.9F));