mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 16:37:43 +01:00
Fill command max area option
This commit is contained in:
43
patches/server/0266-Fill-command-max-area-option.patch
Normal file
43
patches/server/0266-Fill-command-max-area-option.patch
Normal file
@@ -0,0 +1,43 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: BillyGalbreath <Blake.Galbreath@Gmail.com>
|
||||
Date: Sat, 29 Jan 2022 19:39:44 -0600
|
||||
Subject: [PATCH] Fill command max area option
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/commands/FillCommand.java b/src/main/java/net/minecraft/server/commands/FillCommand.java
|
||||
index 5db7c22f3b2db4fc19af007ee45ad0e11fa5e9cb..9e80bcf237e8e968caa692ec386f7cc94023aba1 100644
|
||||
--- a/src/main/java/net/minecraft/server/commands/FillCommand.java
|
||||
+++ b/src/main/java/net/minecraft/server/commands/FillCommand.java
|
||||
@@ -58,8 +58,10 @@ public class FillCommand {
|
||||
|
||||
private static int fillBlocks(CommandSourceStack source, BoundingBox range, BlockInput block, FillCommand.Mode mode, @Nullable Predicate<BlockInWorld> filter) throws CommandSyntaxException {
|
||||
int i = range.getXSpan() * range.getYSpan() * range.getZSpan();
|
||||
- if (i > 32768) {
|
||||
- throw ERROR_AREA_TOO_LARGE.create(32768, i);
|
||||
+ // Purpur start
|
||||
+ if (i > org.purpurmc.purpur.PurpurConfig.commandFillMaxArea) {
|
||||
+ throw ERROR_AREA_TOO_LARGE.create(org.purpurmc.purpur.PurpurConfig.commandFillMaxArea, i);
|
||||
+ // Purpur end
|
||||
} else {
|
||||
List<BlockPos> list = Lists.newArrayList();
|
||||
ServerLevel serverLevel = source.getLevel();
|
||||
diff --git a/src/main/java/org/purpurmc/purpur/PurpurConfig.java b/src/main/java/org/purpurmc/purpur/PurpurConfig.java
|
||||
index ea2b2a2c7aa311826cd78d80dd139b9aa0b83849..eadb28372be56d424b3fec362433a3e8b751d9e2 100644
|
||||
--- a/src/main/java/org/purpurmc/purpur/PurpurConfig.java
|
||||
+++ b/src/main/java/org/purpurmc/purpur/PurpurConfig.java
|
||||
@@ -269,6 +269,7 @@ public class PurpurConfig {
|
||||
public static float commandCompassBarProgressPercent = 1.0F;
|
||||
public static int commandCompassBarTickInterval = 5;
|
||||
public static boolean commandGamemodeRequiresPermission = false;
|
||||
+ public static int commandFillMaxArea = 32768;
|
||||
public static boolean hideHiddenPlayersFromEntitySelector = false;
|
||||
public static String uptimeFormat = "<days><hours><minutes><seconds>";
|
||||
public static String uptimeDay = "%02d day, ";
|
||||
@@ -298,6 +299,7 @@ public class PurpurConfig {
|
||||
commandCompassBarTickInterval = getInt("settings.command.compass.tick-interval", commandCompassBarTickInterval);
|
||||
|
||||
commandGamemodeRequiresPermission = getBoolean("settings.command.gamemode.requires-specific-permission", commandGamemodeRequiresPermission);
|
||||
+ commandFillMaxArea = getInt("settings.command.fill.max-area", commandFillMaxArea);
|
||||
hideHiddenPlayersFromEntitySelector = getBoolean("settings.command.hide-hidden-players-from-entity-selector", hideHiddenPlayersFromEntitySelector);
|
||||
uptimeFormat = getString("settings.command.uptime.format", uptimeFormat);
|
||||
uptimeDay = getString("settings.command.uptime.day", uptimeDay);
|
||||
Reference in New Issue
Block a user