0
0
mirror of https://hub.spigotmc.org/stash/scm/spigot/craftbukkit.git synced 2024-11-22 04:16:17 +00:00
craftbukkit/nms-patches/net/minecraft/server/commands/CommandWorldBorder.patch
2023-06-08 01:30:00 +10:00

66 lines
3.4 KiB
Diff

--- 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();
@@ -71,7 +71,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();
@@ -85,7 +85,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();
@@ -99,7 +99,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();
@@ -113,7 +113,7 @@
}
private static int getSize(CommandListenerWrapper commandlistenerwrapper) {
- double d0 = commandlistenerwrapper.getServer().overworld().getWorldBorder().getSize();
+ double d0 = commandlistenerwrapper.getLevel().getWorldBorder().getSize(); // CraftBukkit
commandlistenerwrapper.sendSuccess(() -> {
return IChatBaseComponent.translatable("commands.worldborder.get", String.format(Locale.ROOT, "%.0f", d0));
@@ -122,7 +122,7 @@
}
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();
@@ -138,7 +138,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) {