2012-02-12 03:03:54 +01:00
|
|
|
package net.minecraft.server;
|
|
|
|
|
|
|
|
import java.util.Random;
|
|
|
|
|
2013-11-04 14:07:38 +01:00
|
|
|
public class BlockNetherWart extends BlockPlant {
|
2012-02-12 03:03:54 +01:00
|
|
|
|
2013-11-04 14:07:38 +01:00
|
|
|
protected BlockNetherWart() {
|
|
|
|
this.a(true);
|
2012-02-12 03:03:54 +01:00
|
|
|
float f = 0.5F;
|
|
|
|
|
|
|
|
this.a(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, 0.25F, 0.5F + f);
|
2012-07-29 09:33:13 +02:00
|
|
|
this.a((CreativeModeTab) null);
|
2012-02-12 03:03:54 +01:00
|
|
|
}
|
|
|
|
|
2013-11-04 14:07:38 +01:00
|
|
|
protected boolean a(Block block) {
|
|
|
|
return block == Blocks.SOUL_SAND;
|
2012-02-12 03:03:54 +01:00
|
|
|
}
|
|
|
|
|
2013-11-04 14:07:38 +01:00
|
|
|
public boolean j(World world, int i, int j, int k) {
|
|
|
|
return this.a(world.getType(i, j - 1, k));
|
2012-03-01 11:49:23 +01:00
|
|
|
}
|
|
|
|
|
2013-03-13 23:33:27 +01:00
|
|
|
public void a(World world, int i, int j, int k, Random random) {
|
2012-02-12 03:03:54 +01:00
|
|
|
int l = world.getData(i, j, k);
|
|
|
|
|
2012-07-29 09:33:13 +02:00
|
|
|
if (l < 3 && random.nextInt(10) == 0) {
|
2013-11-04 14:07:38 +01:00
|
|
|
++l;
|
|
|
|
org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockGrowEvent(world, i, j, k, this, l); // CraftBukkit
|
2012-02-12 03:03:54 +01:00
|
|
|
}
|
|
|
|
|
2013-03-13 23:33:27 +01:00
|
|
|
super.a(world, i, j, k, random);
|
2012-02-12 03:03:54 +01:00
|
|
|
}
|
|
|
|
|
2013-11-04 14:07:38 +01:00
|
|
|
public int b() {
|
2012-02-12 03:03:54 +01:00
|
|
|
return 6;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void dropNaturally(World world, int i, int j, int k, int l, float f, int i1) {
|
|
|
|
if (!world.isStatic) {
|
|
|
|
int j1 = 1;
|
|
|
|
|
|
|
|
if (l >= 3) {
|
|
|
|
j1 = 2 + world.random.nextInt(3);
|
|
|
|
if (i1 > 0) {
|
|
|
|
j1 += world.random.nextInt(i1 + 1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
for (int k1 = 0; k1 < j1; ++k1) {
|
2013-11-04 14:07:38 +01:00
|
|
|
this.a(world, i, j, k, new ItemStack(Items.NETHER_STALK));
|
2012-02-12 03:03:54 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-11-04 14:07:38 +01:00
|
|
|
public Item getDropType(int i, Random random, int j) {
|
|
|
|
return null;
|
2012-02-12 03:03:54 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
public int a(Random random) {
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|