-
Notifications
You must be signed in to change notification settings - Fork 17
/
EntityBlock.java
55 lines (43 loc) · 1.04 KB
/
EntityBlock.java
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
50
51
52
53
54
55
package com.griefcraft.bukkit.v1_7_R4;
import org.bukkit.World;
import org.bukkit.block.Block;
import org.bukkit.craftbukkit.v1_7_R4.block.CraftBlock;
import org.bukkit.entity.Entity;
import com.griefcraft.bukkit.NMS;
public class EntityBlock extends CraftBlock implements NMS {
public static final int ENTITY_BLOCK_ID = 5000;
public static final int POSITION_OFFSET = 50000;
private Entity entity;
public EntityBlock(Entity entity) {
super(null, 0, 0, 0);
this.entity = entity;
}
@Override
public int getX() {
return 50000 + this.entity.getUniqueId().hashCode();
}
@Override
public int getY() {
return 50000 + this.entity.getUniqueId().hashCode();
}
@Override
public int getZ() {
return 50000 + this.entity.getUniqueId().hashCode();
}
@Override
public int getTypeId() {
return 5000;
}
@Override
public World getWorld() {
return this.entity.getWorld();
}
@Override
public Entity getEntity() {
return this.entity;
}
@Override
public Block getEntityBlock(Entity entity) {
return new EntityBlock(entity);
}
}