This commit is contained in:
parent
acae6d5ec7
commit
17bb269f76
2
pom.xml
2
pom.xml
@ -6,7 +6,7 @@
|
||||
|
||||
<groupId>cn.lunadeer</groupId>
|
||||
<artifactId>LiteWorldEdit</artifactId>
|
||||
<version>2.4.3.3</version>
|
||||
<version>2.4.3.4</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>LiteWorldEdit</name>
|
||||
|
@ -40,9 +40,21 @@ public class Absorb extends Job {
|
||||
// 模拟海绵吸水事件
|
||||
BlockPlaceEvent event = new BlockPlaceEvent(raw_block, raw_block.getState(), raw_block, new ItemStack(Material.SPONGE), _creator, true, null);
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
// 获取玩家背包中的下届合金镐
|
||||
HashMap<Integer, ?> pickaxes = getNetherPickaxes(_creator);
|
||||
if (pickaxes.size() == 0) {
|
||||
return JobErrCode.NO_PICKAXE;
|
||||
}
|
||||
ItemStack pickaxe = getUsableNetherPickaxe(pickaxes, _creator);
|
||||
// 没有合适的镐
|
||||
if (pickaxe == null) {
|
||||
return JobErrCode.NOT_ENOUGH_DURATION;
|
||||
}
|
||||
if (!event.isCancelled()) {
|
||||
raw_block.setType(Material.SPONGE);
|
||||
raw_block.setType(Material.AIR);
|
||||
// 损坏镐
|
||||
useNetherPickaxe(pickaxe);
|
||||
return JobErrCode.OK;
|
||||
} else {
|
||||
return JobErrCode.NO_PERMISSION;
|
||||
|
Loading…
Reference in New Issue
Block a user