This commit is contained in:
parent
e8ce830c05
commit
7d673906cf
26
README.md
26
README.md
@ -7,7 +7,7 @@ EssentialsX,其中D代表Deer。
|
||||
|
||||
## 支持版本
|
||||
|
||||
- 1.20.1+ (Paper、Folia)
|
||||
- 1.20.1+ (Folia)
|
||||
|
||||
## 安装方法
|
||||
|
||||
@ -82,9 +82,8 @@ EssentialsX,其中D代表Deer。
|
||||
|
||||
![](https://ssl.lunadeer.cn:14437/i/2024/03/23/65fed55d7815a.png)
|
||||
|
||||
> 以下摘自WIKI:作为一种被设计为隐藏自身存在的方块,光源方块有许多与结构空位相似的性质。光源方块通常是不可见的,并且没有碰撞箱。与结构空位类似,光源方块不会被水或熔岩冲毁,能够阻止其通过。光源方块不能在非创造模式中被挖掘破坏。光源方块会阻碍植物生长。活塞不能推动光源方块。光源方块具有3,600,000.8爆炸抗性,并阻止游戏中的常见爆炸透过光源方块破坏方块。光源方块具有一个完整方块大小的判定箱,但只在玩家手持光源方块时才可以选中,否则玩家只能选中其后方的物体。在光源方块的判定箱上尝试放置不是光源方块的方块时,方块会取代光源方块。光源方块可以含水。含水的光影方块可以通过在光源方块中放置水或在水中放置光源方块来获得,允许玩家创造发光且不会结冰或被熔岩破坏的水体。光源方块是一种“隐形方块”,处于开启了“显示隐形方块”的储存模式结构方块的存储区域范围内的光源方块会显示出一个淡黄色的立方体框。
|
||||
|
||||
|
||||
>
|
||||
以下摘自WIKI:作为一种被设计为隐藏自身存在的方块,光源方块有许多与结构空位相似的性质。光源方块通常是不可见的,并且没有碰撞箱。与结构空位类似,光源方块不会被水或熔岩冲毁,能够阻止其通过。光源方块不能在非创造模式中被挖掘破坏。光源方块会阻碍植物生长。活塞不能推动光源方块。光源方块具有3,600,000.8爆炸抗性,并阻止游戏中的常见爆炸透过光源方块破坏方块。光源方块具有一个完整方块大小的判定箱,但只在玩家手持光源方块时才可以选中,否则玩家只能选中其后方的物体。在光源方块的判定箱上尝试放置不是光源方块的方块时,方块会取代光源方块。光源方块可以含水。含水的光影方块可以通过在光源方块中放置水或在水中放置光源方块来获得,允许玩家创造发光且不会结冰或被熔岩破坏的水体。光源方块是一种“隐形方块”,处于开启了“显示隐形方块”的储存模式结构方块的存储区域范围内的光源方块会显示出一个淡黄色的立方体框。
|
||||
|
||||
## 管理员指南
|
||||
|
||||
@ -100,18 +99,29 @@ EssentialsX,其中D代表Deer。
|
||||
|
||||
使用 `/more [amount]` 可以获取更多手持物品,如果不填写数量则默认为64个。
|
||||
|
||||
### 4. 设置世界时间(暂时只能通过控制台执行)
|
||||
### 4. 设置世界时间
|
||||
|
||||
- 使用 `/day` 可以将世界时间设置为白天。
|
||||
- 使用 `/noon` 可以将世界时间设置为正午。
|
||||
- 使用 `/night` 可以将世界时间设置为黑夜。
|
||||
|
||||
### 5. 设置天气(暂时只能通过控制台执行)
|
||||
### 5. 设置天气
|
||||
|
||||
- 使用 `/sun` 可以将天气设置为晴天。
|
||||
- 使用 `/rain` 可以将天气设置为下雨。
|
||||
- 使用 `/storm` 可以将天气设置为雷雨。
|
||||
|
||||
### 6. 区域强加载
|
||||
|
||||
在 `plugins/EssentialsD/config.yml` 中的 `ForceLoadChunks` 中添加需要强加载的区块,格式为 `world:x:z`,其中 `world`
|
||||
为世界名称,`x` 和 `z` 为区块坐标。
|
||||
|
||||
```yaml
|
||||
ForceLoadChunks:
|
||||
- world:0:0
|
||||
- world_the_end:-12:12
|
||||
```
|
||||
|
||||
## 指令
|
||||
|
||||
以下指令尖括号`<>`表示必填参数,方括号`[]`表示可选参数。
|
||||
@ -146,6 +156,10 @@ EssentialsX,其中D代表Deer。
|
||||
```yaml
|
||||
ExpBottleRatio: 1.0
|
||||
|
||||
ForceLoadChunks:
|
||||
# - world:0:0
|
||||
# - world_the_end:-12:12
|
||||
|
||||
Debug: false
|
||||
```
|
||||
|
||||
|
2
pom.xml
2
pom.xml
@ -6,7 +6,7 @@
|
||||
|
||||
<groupId>cn.lunadeer</groupId>
|
||||
<artifactId>EssentialsD</artifactId>
|
||||
<version>1.11.3</version>
|
||||
<version>1.12.1</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>EssentialsD</name>
|
||||
|
@ -4,6 +4,7 @@ import cn.lunadeer.essentialsd.commands.*;
|
||||
import cn.lunadeer.essentialsd.recipes.*;
|
||||
import cn.lunadeer.essentialsd.utils.ConfigManager;
|
||||
import cn.lunadeer.essentialsd.utils.XLogger;
|
||||
import io.papermc.paper.threadedregions.scheduler.GlobalRegionScheduler;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
@ -16,6 +17,7 @@ public final class EssentialsD extends JavaPlugin {
|
||||
// Plugin startup logic
|
||||
instance = this;
|
||||
config = new ConfigManager(instance);
|
||||
globalScheduler = this.getServer().getGlobalRegionScheduler();
|
||||
|
||||
Bukkit.getPluginManager().registerEvents(new Events(), this);
|
||||
Objects.requireNonNull(Bukkit.getPluginCommand("suicide")).setExecutor(new Suicide());
|
||||
@ -61,4 +63,5 @@ public final class EssentialsD extends JavaPlugin {
|
||||
|
||||
public static EssentialsD instance;
|
||||
public static ConfigManager config;
|
||||
public static GlobalRegionScheduler globalScheduler;
|
||||
}
|
||||
|
@ -29,13 +29,15 @@ public class Day implements CommandExecutor {
|
||||
return false;
|
||||
}
|
||||
// set time to 1000
|
||||
if (sender instanceof Player) {
|
||||
((Player) sender).getWorld().setTime(1000);
|
||||
Notification.info(sender, "设置 " + ((Player) sender).getWorld().getName() + " 时间为白天");
|
||||
} else {
|
||||
EssentialsD.instance.getServer().getWorlds().forEach(world -> world.setTime(1000));
|
||||
Notification.info(sender, "设置时间为白天");
|
||||
}
|
||||
EssentialsD.globalScheduler.run(EssentialsD.instance, (instance) -> {
|
||||
if (sender instanceof Player) {
|
||||
((Player) sender).getWorld().setTime(1000);
|
||||
Notification.info(sender, "设置 " + ((Player) sender).getWorld().getName() + " 时间为白天");
|
||||
} else {
|
||||
EssentialsD.instance.getServer().getWorlds().forEach(world -> world.setTime(1000));
|
||||
Notification.info(sender, "设置时间为白天");
|
||||
}
|
||||
});
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
package cn.lunadeer.essentialsd.commands;
|
||||
|
||||
import cn.lunadeer.essentialsd.EssentialsD;
|
||||
import cn.lunadeer.essentialsd.utils.Notification;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
@ -16,19 +17,21 @@ public class Fly implements CommandExecutor {
|
||||
if (notOpOrConsole(sender)) {
|
||||
return false;
|
||||
}
|
||||
Player target = opCommandGetPlayer(sender, args);
|
||||
if (target == null) {
|
||||
return false;
|
||||
}
|
||||
if (target.getAllowFlight()) {
|
||||
target.setAllowFlight(false);
|
||||
Notification.info(sender, "已关闭玩家 " + target.getName() + " 的飞行模式");
|
||||
Notification.info(target, "已关闭飞行模式");
|
||||
} else {
|
||||
target.setAllowFlight(true);
|
||||
Notification.info(sender, "已开启玩家 " + target.getName() + " 的飞行模式");
|
||||
Notification.info(target, "已开启飞行模式");
|
||||
}
|
||||
EssentialsD.globalScheduler.run(EssentialsD.instance, (instance) -> {
|
||||
Player target = opCommandGetPlayer(sender, args);
|
||||
if (target == null) {
|
||||
return;
|
||||
}
|
||||
if (target.getAllowFlight()) {
|
||||
target.setAllowFlight(false);
|
||||
Notification.info(sender, "已关闭玩家 " + target.getName() + " 的飞行模式");
|
||||
Notification.info(target, "已关闭飞行模式");
|
||||
} else {
|
||||
target.setAllowFlight(true);
|
||||
Notification.info(sender, "已开启玩家 " + target.getName() + " 的飞行模式");
|
||||
Notification.info(target, "已开启飞行模式");
|
||||
}
|
||||
});
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
package cn.lunadeer.essentialsd.commands;
|
||||
|
||||
import cn.lunadeer.essentialsd.EssentialsD;
|
||||
import cn.lunadeer.essentialsd.utils.Notification;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
@ -16,19 +17,21 @@ public class God implements CommandExecutor {
|
||||
if (notOpOrConsole(sender)) {
|
||||
return false;
|
||||
}
|
||||
Player target = opCommandGetPlayer(sender, args);
|
||||
if (target == null) {
|
||||
return false;
|
||||
}
|
||||
if (target.isInvulnerable()) {
|
||||
target.setInvulnerable(false);
|
||||
Notification.info(sender, "已关闭玩家 " + target.getName() + " 的无敌模式");
|
||||
Notification.info(target, "已关闭无敌模式");
|
||||
} else {
|
||||
target.setInvulnerable(true);
|
||||
Notification.info(sender, "已开启玩家 " + target.getName() + " 的无敌模式");
|
||||
Notification.info(target, "已开启无敌模式");
|
||||
}
|
||||
EssentialsD.globalScheduler.run(EssentialsD.instance, (instance) -> {
|
||||
Player target = opCommandGetPlayer(sender, args);
|
||||
if (target == null) {
|
||||
return;
|
||||
}
|
||||
if (target.isInvulnerable()) {
|
||||
target.setInvulnerable(false);
|
||||
Notification.info(sender, "已关闭玩家 " + target.getName() + " 的无敌模式");
|
||||
Notification.info(target, "已关闭无敌模式");
|
||||
} else {
|
||||
target.setInvulnerable(true);
|
||||
Notification.info(sender, "已开启玩家 " + target.getName() + " 的无敌模式");
|
||||
Notification.info(target, "已开启无敌模式");
|
||||
}
|
||||
});
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -29,13 +29,15 @@ public class Night implements CommandExecutor {
|
||||
return false;
|
||||
}
|
||||
// set time to 13000
|
||||
if (sender instanceof Player) {
|
||||
((Player) sender).getWorld().setTime(13000);
|
||||
Notification.info(sender, "设置 " + ((Player) sender).getWorld().getName() + " 时间为夜晚");
|
||||
} else {
|
||||
EssentialsD.instance.getServer().getWorlds().forEach(world -> world.setTime(13000));
|
||||
Notification.info(sender, "设置时间为夜晚");
|
||||
}
|
||||
EssentialsD.globalScheduler.run(EssentialsD.instance, (instance) -> {
|
||||
if (sender instanceof Player) {
|
||||
((Player) sender).getWorld().setTime(13000);
|
||||
Notification.info(sender, "设置 " + ((Player) sender).getWorld().getName() + " 时间为夜晚");
|
||||
} else {
|
||||
EssentialsD.instance.getServer().getWorlds().forEach(world -> world.setTime(13000));
|
||||
Notification.info(sender, "设置时间为夜晚");
|
||||
}
|
||||
});
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -29,13 +29,15 @@ public class Noon implements CommandExecutor {
|
||||
return false;
|
||||
}
|
||||
// set time to 6000
|
||||
if (sender instanceof Player) {
|
||||
((Player) sender).getWorld().setTime(6000);
|
||||
Notification.info(sender, "设置 " + ((Player) sender).getWorld().getName() + " 时间为正午");
|
||||
} else {
|
||||
EssentialsD.instance.getServer().getWorlds().forEach(world -> world.setTime(6000));
|
||||
Notification.info(sender, "设置时间为正午");
|
||||
}
|
||||
EssentialsD.globalScheduler.run(EssentialsD.instance, (instance) -> {
|
||||
if (sender instanceof Player) {
|
||||
((Player) sender).getWorld().setTime(6000);
|
||||
Notification.info(sender, "设置 " + ((Player) sender).getWorld().getName() + " 时间为正午");
|
||||
} else {
|
||||
EssentialsD.instance.getServer().getWorlds().forEach(world -> world.setTime(6000));
|
||||
Notification.info(sender, "设置时间为正午");
|
||||
}
|
||||
});
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,7 @@
|
||||
package cn.lunadeer.essentialsd.commands;
|
||||
|
||||
import cn.lunadeer.essentialsd.EssentialsD;
|
||||
import cn.lunadeer.essentialsd.utils.Notification;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
@ -16,8 +18,11 @@ public class Rain implements CommandExecutor {
|
||||
return true;
|
||||
}
|
||||
// 设置天气为雨天
|
||||
player.getWorld().setStorm(true);
|
||||
player.getWorld().setThundering(false);
|
||||
EssentialsD.globalScheduler.run(EssentialsD.instance, (instance) -> {
|
||||
player.getWorld().setStorm(true);
|
||||
player.getWorld().setThundering(false);
|
||||
Notification.info(player, "设置 " + player.getWorld().getName() + " 天气为雨天");
|
||||
});
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,7 @@
|
||||
package cn.lunadeer.essentialsd.commands;
|
||||
|
||||
import cn.lunadeer.essentialsd.EssentialsD;
|
||||
import cn.lunadeer.essentialsd.utils.Notification;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
@ -16,8 +18,11 @@ public class Storm implements CommandExecutor {
|
||||
return true;
|
||||
}
|
||||
// 设置天气为雷雨
|
||||
player.getWorld().setStorm(true);
|
||||
player.getWorld().setThundering(true);
|
||||
EssentialsD.globalScheduler.run(EssentialsD.instance, (instance) -> {
|
||||
player.getWorld().setStorm(true);
|
||||
player.getWorld().setThundering(true);
|
||||
Notification.info(player, "设置 " + player.getWorld().getName() + " 天气为雷雨");
|
||||
});
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,7 @@
|
||||
package cn.lunadeer.essentialsd.commands;
|
||||
|
||||
import cn.lunadeer.essentialsd.EssentialsD;
|
||||
import cn.lunadeer.essentialsd.utils.Notification;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
@ -15,9 +17,12 @@ public class Sun implements CommandExecutor {
|
||||
if (player == null) {
|
||||
return true;
|
||||
}
|
||||
// 设置天气为晴朗
|
||||
player.getWorld().setStorm(false);
|
||||
player.getWorld().setThundering(false);
|
||||
EssentialsD.globalScheduler.run(EssentialsD.instance, (instance) -> {
|
||||
// 设置天气为晴朗
|
||||
player.getWorld().setStorm(false);
|
||||
player.getWorld().setThundering(false);
|
||||
Notification.info(player, "设置 " + player.getWorld().getName() + " 天气为晴朗");
|
||||
});
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -58,9 +58,10 @@ public class ConfigManager {
|
||||
XLogger.warn("ForceLoadChunks 配置错误: 世界 " + world_name + " 不存在");
|
||||
continue;
|
||||
}
|
||||
// todo: 需要调用 io.papermc.paper.threadedregions.RegionizedServer.getInstance() 同步
|
||||
// world.setChunkForceLoaded(x, z, true);
|
||||
// XLogger.info("标记强加载区块: " + world_name + " " + x + " " + z);
|
||||
EssentialsD.globalScheduler.run(EssentialsD.instance, (instance) -> {
|
||||
world.setChunkForceLoaded(x, z, true);
|
||||
XLogger.info("标记强加载区块: " + world_name + " " + x + " " + z);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2,6 +2,6 @@ ExpBottleRatio: 1.0
|
||||
|
||||
ForceLoadChunks:
|
||||
# - world:0:0
|
||||
# - world_the_end:
|
||||
# - world_the_end:-12:12
|
||||
|
||||
Debug: false
|
Loading…
Reference in New Issue
Block a user