Jump to content

[SOLVED]Bonemeal particles


Nizen

Recommended Posts

Sorry for my bad English, I`m from Poland.

 

Code:

package rpgcraft;
import java.awt.Event;
import java.util.ArrayList;
import java.util.Random;

import rpgcraft.blocks.Blockdarksapling;
import rpgcraft.blocks.blocks;
import net.minecraft.block.Block;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import net.minecraftforge.event.Event.Result;
import net.minecraftforge.event.ForgeSubscribe;
import net.minecraftforge.event.entity.player.BonemealEvent;

public class EventClass
{


@ForgeSubscribe
public void usedBonemeal(BonemealEvent event)
{
 int i = 0;
 int j =  (new Random()).nextInt(5);


 if (event.ID == blocks.darksapling.blockID)
 {
 if (i != j)
 i += i;
 else if (i == j)
 {
 if (!event.world.isRemote)
 {
	 ((Blockdarksapling)blocks.darksapling).growTree(event.world, event.X, event.Y, event.Z, event.world.rand);
	 event.setResult(Result.ALLOW);
 }
 }
 }
}
}

 

It work, tree is generating, but it don`t showing particles. Why? And how to fix it?

Link to comment
Share on other sites

Sorry for my bad English, I`m from Poland.

 

Code:

package rpgcraft;
import java.awt.Event;
import java.util.ArrayList;
import java.util.Random;

import rpgcraft.blocks.Blockdarksapling;
import rpgcraft.blocks.blocks;
import net.minecraft.block.Block;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import net.minecraftforge.event.Event.Result;
import net.minecraftforge.event.ForgeSubscribe;
import net.minecraftforge.event.entity.player.BonemealEvent;

public class EventClass
{


@ForgeSubscribe
public void usedBonemeal(BonemealEvent event)
{
 int i = 0;
 int j =  (new Random()).nextInt(5);


 if (event.ID == blocks.darksapling.blockID)
 {
 if (i != j)
 i += i;
 else if (i == j)
 {
 if (!event.world.isRemote)
 {
	 ((Blockdarksapling)blocks.darksapling).growTree(event.world, event.X, event.Y, event.Z, event.world.rand);
	 event.setResult(Result.ALLOW);
 }
 }
 }
}
}

 

It work, tree is generating, but it don`t showing particles. Why? And how to fix it?

 

put this in the usedBonemeal event

par3World.spawnParticle("villagerHappy", par4, par5, par6, 0.0D, 0.5D, 0.0D);

Link to comment
Share on other sites

Now, when I use:

public void usedBonemeal(World par3World, BonemealEvent event)

eclipse don`t show any errors, but minecraft has crashing.

 

When I use:

public void usedBonemeal(BonemealEvent event)

eclipse asking about change

public void spawnParticle(String par1Str, double par2, double par4, double par6, double par8, double par10, double par12)
    {
...
    }

to static. I can`t do it, becouse that make a lot of errors in other files (and i don`t edit vanilla code :P)

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.