新增op与创造玩家可以无损使用lwe
Some checks failed
Java CI-CD with Maven / build (push) Failing after 32m39s

This commit is contained in:
zhangyuheng 2024-07-01 15:46:41 +08:00
parent 3038fc6e3c
commit e7cb4cfb80
4 changed files with 13 additions and 16 deletions

View File

@ -6,7 +6,7 @@
<groupId>cn.lunadeer</groupId>
<artifactId>LiteWorldEdit</artifactId>
<version>2.4.3.5</version>
<version>2.4.3.6</version>
<packaging>jar</packaging>
<name>LiteWorldEdit</name>

View File

@ -1,10 +1,7 @@
package cn.lunadeer.liteworldedit.Jobs;
import cn.lunadeer.liteworldedit.LoggerX;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.World;
import org.bukkit.*;
import org.bukkit.block.Block;
import org.bukkit.entity.Player;
import org.bukkit.event.block.BlockPlaceEvent;
@ -54,7 +51,9 @@ public class Absorb extends Job {
raw_block.setType(Material.SPONGE);
raw_block.setType(Material.AIR);
// 损坏镐
useNetherPickaxe(pickaxe);
if (!_creator.isOp() && _creator.getGameMode() != GameMode.CREATIVE) {
useNetherPickaxe(pickaxe);
}
return JobErrCode.OK;
} else {
return JobErrCode.NO_PERMISSION;

View File

@ -1,10 +1,7 @@
package cn.lunadeer.liteworldedit.Jobs;
import cn.lunadeer.liteworldedit.LoggerX;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.World;
import org.bukkit.*;
import org.bukkit.block.Block;
import org.bukkit.block.ShulkerBox;
import org.bukkit.entity.Player;
@ -75,7 +72,9 @@ public class Place extends Job {
Bukkit.getPluginManager().callEvent(event);
if (!event.isCancelled()) {
raw_block.setType(_block);
stack.setAmount(stack.getAmount() - 1);
if (!_creator.isOp() && _creator.getGameMode() != GameMode.CREATIVE) {
stack.setAmount(stack.getAmount() - 1);
}
return JobErrCode.OK;
} else {
return JobErrCode.NO_PERMISSION;

View File

@ -2,10 +2,7 @@ package cn.lunadeer.liteworldedit.Jobs;
import cn.lunadeer.liteworldedit.LiteWorldEdit;
import cn.lunadeer.liteworldedit.LoggerX;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.World;
import org.bukkit.*;
import org.bukkit.block.Block;
import org.bukkit.entity.Player;
import org.bukkit.event.block.BlockBreakEvent;
@ -53,7 +50,9 @@ public class Remove extends Job {
raw_block.getWorld().dropItemNaturally(raw_block.getLocation(), new ItemStack(raw_block.getType()));
}
// 损坏镐
useNetherPickaxe(pickaxe);
if (!_creator.isOp() && _creator.getGameMode() != GameMode.CREATIVE) {
useNetherPickaxe(pickaxe);
}
return JobErrCode.OK;
} else {
return JobErrCode.NO_PERMISSION;