forked from CloudburstMC/Nukkit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBlockOreRedstoneDeepslateGlowing.java
More file actions
47 lines (37 loc) · 1.16 KB
/
BlockOreRedstoneDeepslateGlowing.java
File metadata and controls
47 lines (37 loc) · 1.16 KB
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
package cn.nukkit.block;
import cn.nukkit.event.block.BlockFadeEvent;
import cn.nukkit.item.Item;
import cn.nukkit.item.ItemBlock;
import cn.nukkit.level.Level;
public class BlockOreRedstoneDeepslateGlowing extends BlockOreRedstoneDeepslate {
public BlockOreRedstoneDeepslateGlowing() {
}
@Override
public int getId() {
return LIT_DEEPSLATE_REDSTONE_ORE;
}
@Override
public String getName() {
return "Glowing Deepslate Redstone Ore";
}
@Override
public int getLightLevel() {
return 9;
}
@Override
public Item toItem() {
return new ItemBlock(Block.get(DEEPSLATE_REDSTONE_ORE));
}
@Override
public int onUpdate(int type) {
if (type == Level.BLOCK_UPDATE_SCHEDULED || type == Level.BLOCK_UPDATE_RANDOM) {
BlockFadeEvent event = new BlockFadeEvent(this, Block.get(DEEPSLATE_REDSTONE_ORE));
level.getServer().getPluginManager().callEvent(event);
if (!event.isCancelled()) {
level.setBlock(this, event.getNewState(), false, true);
}
return Level.BLOCK_UPDATE_WEAK;
}
return 0;
}
}