吸水新增消耗下届合金耐久度
All checks were successful
Java CI-CD with Maven / build (push) Successful in 5m38s

This commit is contained in:
zhangyuheng 2024-05-30 10:55:26 +08:00
parent acae6d5ec7
commit 17bb269f76
2 changed files with 13 additions and 1 deletions

View File

@ -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>

View File

@ -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;