mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-05 18:27:17 +01:00
Fix per-world worldborder command
By: md_5 <git@md-5.net>
This commit is contained in:
parent
ee342addea
commit
9f2d553877
1 changed files with 64 additions and 0 deletions
|
@ -0,0 +1,64 @@
|
|||
--- a/net/minecraft/server/commands/CommandWorldBorder.java
|
||||
+++ b/net/minecraft/server/commands/CommandWorldBorder.java
|
||||
@@ -57,7 +57,7 @@
|
||||
}
|
||||
|
||||
private static int setDamageBuffer(CommandListenerWrapper commandlistenerwrapper, float f) throws CommandSyntaxException {
|
||||
- WorldBorder worldborder = commandlistenerwrapper.getServer().overworld().getWorldBorder();
|
||||
+ WorldBorder worldborder = commandlistenerwrapper.getLevel().getWorldBorder(); // CraftBukkit
|
||||
|
||||
if (worldborder.getDamageSafeZone() == (double) f) {
|
||||
throw CommandWorldBorder.ERROR_SAME_DAMAGE_BUFFER.create();
|
||||
@@ -69,7 +69,7 @@
|
||||
}
|
||||
|
||||
private static int setDamageAmount(CommandListenerWrapper commandlistenerwrapper, float f) throws CommandSyntaxException {
|
||||
- WorldBorder worldborder = commandlistenerwrapper.getServer().overworld().getWorldBorder();
|
||||
+ WorldBorder worldborder = commandlistenerwrapper.getLevel().getWorldBorder(); // CraftBukkit
|
||||
|
||||
if (worldborder.getDamagePerBlock() == (double) f) {
|
||||
throw CommandWorldBorder.ERROR_SAME_DAMAGE_AMOUNT.create();
|
||||
@@ -81,7 +81,7 @@
|
||||
}
|
||||
|
||||
private static int setWarningTime(CommandListenerWrapper commandlistenerwrapper, int i) throws CommandSyntaxException {
|
||||
- WorldBorder worldborder = commandlistenerwrapper.getServer().overworld().getWorldBorder();
|
||||
+ WorldBorder worldborder = commandlistenerwrapper.getLevel().getWorldBorder(); // CraftBukkit
|
||||
|
||||
if (worldborder.getWarningTime() == i) {
|
||||
throw CommandWorldBorder.ERROR_SAME_WARNING_TIME.create();
|
||||
@@ -93,7 +93,7 @@
|
||||
}
|
||||
|
||||
private static int setWarningDistance(CommandListenerWrapper commandlistenerwrapper, int i) throws CommandSyntaxException {
|
||||
- WorldBorder worldborder = commandlistenerwrapper.getServer().overworld().getWorldBorder();
|
||||
+ WorldBorder worldborder = commandlistenerwrapper.getLevel().getWorldBorder(); // CraftBukkit
|
||||
|
||||
if (worldborder.getWarningBlocks() == i) {
|
||||
throw CommandWorldBorder.ERROR_SAME_WARNING_DISTANCE.create();
|
||||
@@ -105,14 +105,14 @@
|
||||
}
|
||||
|
||||
private static int getSize(CommandListenerWrapper commandlistenerwrapper) {
|
||||
- double d0 = commandlistenerwrapper.getServer().overworld().getWorldBorder().getSize();
|
||||
+ double d0 = commandlistenerwrapper.getLevel().getWorldBorder().getSize(); // CraftBukkit
|
||||
|
||||
commandlistenerwrapper.sendSuccess(new ChatMessage("commands.worldborder.get", new Object[]{String.format(Locale.ROOT, "%.0f", d0)}), false);
|
||||
return MathHelper.floor(d0 + 0.5D);
|
||||
}
|
||||
|
||||
private static int setCenter(CommandListenerWrapper commandlistenerwrapper, Vec2F vec2f) throws CommandSyntaxException {
|
||||
- WorldBorder worldborder = commandlistenerwrapper.getServer().overworld().getWorldBorder();
|
||||
+ WorldBorder worldborder = commandlistenerwrapper.getLevel().getWorldBorder(); // CraftBukkit
|
||||
|
||||
if (worldborder.getCenterX() == (double) vec2f.x && worldborder.getCenterZ() == (double) vec2f.y) {
|
||||
throw CommandWorldBorder.ERROR_SAME_CENTER.create();
|
||||
@@ -126,7 +126,7 @@
|
||||
}
|
||||
|
||||
private static int setSize(CommandListenerWrapper commandlistenerwrapper, double d0, long i) throws CommandSyntaxException {
|
||||
- WorldBorder worldborder = commandlistenerwrapper.getServer().overworld().getWorldBorder();
|
||||
+ WorldBorder worldborder = commandlistenerwrapper.getLevel().getWorldBorder(); // CraftBukkit
|
||||
double d1 = worldborder.getSize();
|
||||
|
||||
if (d1 == d0) {
|
Loading…
Reference in a new issue