craftbukkit/src/main/java/net/minecraft/server/BlockMobSpawner.java

47 lines
1.1 KiB
Java
Raw Normal View History

2011-09-26 03:07:06 -04:00
package net.minecraft.server;
import java.util.Random;
public class BlockMobSpawner extends BlockContainer {
protected BlockMobSpawner(int i, int j) {
super(i, j, Material.STONE);
}
public TileEntity a_() {
return new TileEntityMobSpawner();
}
2011-11-20 00:01:14 -08:00
public int a(int i, Random random, int j) {
2011-09-26 03:07:06 -04:00
return Block.MOB_SPAWNER.id; // CraftBukkit
}
public int a(Random random) {
2011-11-20 00:01:14 -08:00
return 0;
2011-09-26 03:07:06 -04:00
}
// CraftBukkit start
2011-11-20 00:01:14 -08:00
@Override
public void dropNaturally(World world, int i, int j, int k, int l, float f, int i1) {
2011-09-26 03:07:06 -04:00
TileEntity entity = world.getTileEntity(i, j, k);
if (entity instanceof TileEntityMobSpawner) {
2011-11-20 00:01:14 -08:00
super.dropNaturally(world, i, j, k, ((TileEntityMobSpawner) entity).getId(), f, i1);
2011-09-26 03:07:06 -04:00
}
}
2011-11-20 00:01:14 -08:00
@Override
2011-09-26 03:07:06 -04:00
public void remove(World world, int i, int j, int k) {
2011-11-20 00:01:14 -08:00
dropNaturally(world, i, j, k, 0, 1.0f, 0);
2011-09-26 03:07:06 -04:00
super.remove(world, i, j, k);
}
2011-11-20 00:01:14 -08:00
protected int c(int i) {
2011-09-26 03:07:06 -04:00
return i;
}
// CraftBukkit end
public boolean a() {
return false;
}
}