Compare commits

..

4 Commits

Author SHA1 Message Date
7fd8f8450c 修复了无法产生掉落物的问题
All checks were successful
Java CI-CD with Maven / build (push) Successful in 17m12s
2024-09-19 22:58:16 +08:00
198c4dd426 新增权限节点
All checks were successful
Java CI-CD with Maven / build (push) Successful in 7m17s
2024-07-08 14:09:49 +08:00
e7cb4cfb80 新增op与创造玩家可以无损使用lwe
Some checks failed
Java CI-CD with Maven / build (push) Failing after 32m39s
2024-07-01 15:46:41 +08:00
3038fc6e3c 修改警告提示位置
All checks were successful
Java CI-CD with Maven / build (push) Successful in 6m26s
2024-05-30 11:05:04 +08:00
6 changed files with 29 additions and 19 deletions

View File

@ -6,7 +6,7 @@
<groupId>cn.lunadeer</groupId>
<artifactId>LiteWorldEdit</artifactId>
<version>2.4.3.4</version>
<version>2.4.3.8</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;
@ -48,12 +45,15 @@ public class Remove extends Job {
BlockBreakEvent event = new BlockBreakEvent(raw_block, _creator);
Bukkit.getPluginManager().callEvent(event);
if (!event.isCancelled()) {
Material block_type = raw_block.getType();
raw_block.setType(Material.AIR);
if (LiteWorldEdit.instance.getConfigMgr().isDropItems()) {
raw_block.getWorld().dropItemNaturally(raw_block.getLocation(), new ItemStack(raw_block.getType()));
raw_block.getWorld().dropItemNaturally(raw_block.getLocation(), new ItemStack(block_type));
}
// 损坏镐
useNetherPickaxe(pickaxe);
if (!_creator.isOp() && _creator.getGameMode() != GameMode.CREATIVE) {
useNetherPickaxe(pickaxe);
}
return JobErrCode.OK;
} else {
return JobErrCode.NO_PERMISSION;

View File

@ -2,6 +2,11 @@ package cn.lunadeer.liteworldedit;
import cn.lunadeer.liteworldedit.Jobs.Job;
import cn.lunadeer.liteworldedit.Jobs.JobErrCode;
import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.TextComponent;
import net.kyori.adventure.text.format.Style;
import net.kyori.adventure.text.format.TextColor;
import net.kyori.adventure.text.format.TextDecoration;
import org.bukkit.entity.Player;
public class Task implements Runnable {
@ -40,7 +45,8 @@ public class Task implements Runnable {
}
Player player = job.get_creator();
if (re.canContinue()) {
Notification.titleWarn(player, "警告", re.getMessage());
TextComponent warn = Component.text("警告:" + re.getMessage(), Style.style(TextColor.color(TextColor.color(255, 185, 69)), TextDecoration.BOLD));
player.sendActionBar(warn);
job = this.xPlayer.popJob();
if (job == null) {
return;

View File

@ -12,4 +12,10 @@ commands:
LiteWorldEdit:
description: 简易创世神命令
usage: /lwe <cmd>
aliases: [lwe]
aliases: [ lwe ]
permission: lwe.command
permission-message: 你没有权限使用这个命令。
permissions:
lwe.command:
description: 是否允许使用 LiteWorldEdit
default: true