summaryrefslogtreecommitdiffstats
path: root/src/main/java/net/minecraft/server/BlockMobSpawner.java
blob: d3a29ca86058710116c93f85414a3c3b5bfbc8b5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
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();
    }

    public int a(int i, Random random, int j) {
        return Block.MOB_SPAWNER.id; // CraftBukkit
    }

    public int a(Random random) {
        return 0;
    }

    // CraftBukkit start
    @Override
    public void dropNaturally(World world, int i, int j, int k, int l, float f, int i1) {
        TileEntity entity = world.getTileEntity(i, j, k);
        if (entity instanceof TileEntityMobSpawner) {
            super.dropNaturally(world, i, j, k, ((TileEntityMobSpawner) entity).getId(), f, i1);
        }
    }

    @Override
    public void remove(World world, int i, int j, int k) {
        dropNaturally(world, i, j, k, 0, 1.0f, 0);
        super.remove(world, i, j, k);
    }

    protected int c(int i) {
        return i;
    }
    // CraftBukkit end

    public boolean a() {
        return false;
    }
}