Paper/patch-remap/mache-spigotflower-stripped/net/minecraft/server/commands/WorldBorderCommand.java.patch

80 lines
4.1 KiB
Diff

--- a/net/minecraft/server/commands/WorldBorderCommand.java
+++ b/net/minecraft/server/commands/WorldBorderCommand.java
@@ -57,8 +56,8 @@
})))));
}
- private static int setDamageBuffer(CommandSourceStack commandsourcestack, float f) throws CommandSyntaxException {
- WorldBorder worldborder = commandsourcestack.getServer().overworld().getWorldBorder();
+ private static int setDamageBuffer(CommandSourceStack source, float distance) throws CommandSyntaxException {
+ WorldBorder worldborder = source.getLevel().getWorldBorder(); // CraftBukkit
if (worldborder.getDamageSafeZone() == (double) f) {
throw WorldBorderCommand.ERROR_SAME_DAMAGE_BUFFER.create();
@@ -71,8 +70,8 @@
}
}
- private static int setDamageAmount(CommandSourceStack commandsourcestack, float f) throws CommandSyntaxException {
- WorldBorder worldborder = commandsourcestack.getServer().overworld().getWorldBorder();
+ private static int setDamageAmount(CommandSourceStack source, float damagePerBlock) throws CommandSyntaxException {
+ WorldBorder worldborder = source.getLevel().getWorldBorder(); // CraftBukkit
if (worldborder.getDamagePerBlock() == (double) f) {
throw WorldBorderCommand.ERROR_SAME_DAMAGE_AMOUNT.create();
@@ -85,8 +84,8 @@
}
}
- private static int setWarningTime(CommandSourceStack commandsourcestack, int i) throws CommandSyntaxException {
- WorldBorder worldborder = commandsourcestack.getServer().overworld().getWorldBorder();
+ private static int setWarningTime(CommandSourceStack source, int time) throws CommandSyntaxException {
+ WorldBorder worldborder = source.getLevel().getWorldBorder(); // CraftBukkit
if (worldborder.getWarningTime() == i) {
throw WorldBorderCommand.ERROR_SAME_WARNING_TIME.create();
@@ -99,8 +98,8 @@
}
}
- private static int setWarningDistance(CommandSourceStack commandsourcestack, int i) throws CommandSyntaxException {
- WorldBorder worldborder = commandsourcestack.getServer().overworld().getWorldBorder();
+ private static int setWarningDistance(CommandSourceStack source, int distance) throws CommandSyntaxException {
+ WorldBorder worldborder = source.getLevel().getWorldBorder(); // CraftBukkit
if (worldborder.getWarningBlocks() == i) {
throw WorldBorderCommand.ERROR_SAME_WARNING_DISTANCE.create();
@@ -113,8 +112,8 @@
}
}
- private static int getSize(CommandSourceStack commandsourcestack) {
- double d0 = commandsourcestack.getServer().overworld().getWorldBorder().getSize();
+ private static int getSize(CommandSourceStack source) {
+ double d0 = source.getLevel().getWorldBorder().getSize(); // CraftBukkit
commandsourcestack.sendSuccess(() -> {
return Component.translatable("commands.worldborder.get", String.format(Locale.ROOT, "%.0f", d0));
@@ -122,8 +121,8 @@
return Mth.floor(d0 + 0.5D);
}
- private static int setCenter(CommandSourceStack commandsourcestack, Vec2 vec2) throws CommandSyntaxException {
- WorldBorder worldborder = commandsourcestack.getServer().overworld().getWorldBorder();
+ private static int setCenter(CommandSourceStack source, Vec2 pos) throws CommandSyntaxException {
+ WorldBorder worldborder = source.getLevel().getWorldBorder(); // CraftBukkit
if (worldborder.getCenterX() == (double) vec2.x && worldborder.getCenterZ() == (double) vec2.y) {
throw WorldBorderCommand.ERROR_SAME_CENTER.create();
@@ -138,8 +137,8 @@
}
}
- private static int setSize(CommandSourceStack commandsourcestack, double d0, long i) throws CommandSyntaxException {
- WorldBorder worldborder = commandsourcestack.getServer().overworld().getWorldBorder();
+ private static int setSize(CommandSourceStack source, double newSize, long i) throws CommandSyntaxException {
+ WorldBorder worldborder = source.getLevel().getWorldBorder(); // CraftBukkit
double d1 = worldborder.getSize();
if (d1 == d0) {