-
-
Notifications
You must be signed in to change notification settings - Fork 104
/
FakeBlock.java
27 lines (19 loc) · 934 Bytes
/
FakeBlock.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
package net.aufdemrand.denizen.utilities.blocks;
import net.aufdemrand.denizen.objects.*;
import net.aufdemrand.denizen.utilities.DenizenAPI;
import org.bukkit.Bukkit;
public class FakeBlock {
public FakeBlock(final dPlayer player, final dLocation location, final dMaterial material, final Duration duration) {
player.getPlayerEntity()
.sendBlockChange(location, material.getMaterial(), material.getMaterialData().getData());
Bukkit.getScheduler().scheduleSyncDelayedTask(DenizenAPI.getCurrentInstance(),
new Runnable() {
@Override
public void run() {
player.getPlayerEntity()
.sendBlockChange(location, location.getBlock().getType(),
location.getBlock().getData());
}
}, duration.getTicks());
}
}