blob: 3639ec7330ace712d319ed20f3b8831ad4d3b51d (
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
47
48
49
|
package net.minecraft.server;
// CraftBukkit start
import org.bukkit.craftbukkit.block.CraftBlock;
import org.bukkit.craftbukkit.entity.CraftPlayer;
import org.bukkit.event.Event.Type;
import org.bukkit.event.block.BlockInteractEvent;
// CraftBukkit end
public class BlockWorkbench extends Block {
protected BlockWorkbench(int i) {
super(i, Material.c);
bh = 59;
}
public int a(int i) {
if (i == 1) {
return bh - 16;
}
if (i == 0) {
return Block.x.a(0);
}
if (i == 2 || i == 4) {
return bh + 1;
} else {
return bh;
}
}
public boolean a(World world, int i, int j, int k, EntityPlayer entityplayer) {
if (world.z) {
return true;
} else {
// CraftBukkit start - Interact Workbench
CraftBlock block = (CraftBlock) ((WorldServer) world).getWorld().getBlockAt(i, j, k);
CraftPlayer player = new CraftPlayer(((WorldServer) world).getServer(), (EntityPlayerMP) entityplayer);
BlockInteractEvent bie = new BlockInteractEvent(Type.BLOCK_INTERACT, block, player);
((WorldServer) world).getServer().getPluginManager().callEvent(bie);
if (bie.isCancelled()) return true;
// CraftBukkit end
entityplayer.a(i, j, k);
return true;
}
}
}
|