Files
Purpur/patches/server/0132-EMC-Configurable-disable-give-dropping.patch
William Blake Galbreath b2056c256f Updated Upstream (Paper)
Upstream has released updates that appear to apply and compile correctly

Paper Changes:
9b0a0d8 Add the default tick rate of the sensor to the timings (#6242)
e905eb1 Add fireball to default max load config (#6252)
2f1f1b7 Add config option to specify timings url (#6256)
efd7e51 Move "use-display-name-in-quit-message" to settings namespace (#6257)
b32a3b1 Call EntityKnockbackByEntityEvent for RamTarget Behavior (#6273)
2021-07-26 21:42:01 -05:00

38 lines
2.2 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Thu, 14 Jan 2016 00:49:14 -0500
Subject: [PATCH] EMC - Configurable disable give dropping
Modified version of a patch by Aikar from EMC. Adds a config option in
purpur.yml to disable the /give command from dropping items on the
floor when a player's inventory is full.
diff --git a/src/main/java/net/minecraft/server/commands/GiveCommand.java b/src/main/java/net/minecraft/server/commands/GiveCommand.java
index a0dc380e90415de9068ea408d62a1605c82631df..60fd566f7e1499ecf2ad91216a667f12cb0e05de 100644
--- a/src/main/java/net/minecraft/server/commands/GiveCommand.java
+++ b/src/main/java/net/minecraft/server/commands/GiveCommand.java
@@ -45,6 +45,7 @@ public class GiveCommand {
k -= l;
ItemStack itemStack = item.createItemStack(l, false);
boolean bl = serverPlayer.getInventory().add(itemStack);
+ if (net.pl3x.purpur.PurpurConfig.disableGiveCommandDrops) continue; // Purpur - add config option for toggling give command dropping
if (bl && itemStack.isEmpty()) {
itemStack.setCount(1);
ItemEntity itemEntity2 = serverPlayer.drop(itemStack, false, false, true); // Paper - Fix duplicating /give items on item drop cancel
diff --git a/src/main/java/net/pl3x/purpur/PurpurConfig.java b/src/main/java/net/pl3x/purpur/PurpurConfig.java
index 731c85911c3d763d06f9f6a602f93e33eeadf3f6..ad4908c00ea98ea26aa211436c572b4ec04cd030 100644
--- a/src/main/java/net/pl3x/purpur/PurpurConfig.java
+++ b/src/main/java/net/pl3x/purpur/PurpurConfig.java
@@ -326,6 +326,11 @@ public class PurpurConfig {
useAlternateKeepAlive = getBoolean("settings.use-alternate-keepalive", useAlternateKeepAlive);
}
+ public static boolean disableGiveCommandDrops = false;
+ private static void disableGiveCommandDrops() {
+ disableGiveCommandDrops = getBoolean("settings.disable-give-dropping", disableGiveCommandDrops);
+ }
+
public static boolean barrelSixRows = false;
public static boolean enderChestSixRows = false;
public static boolean enderChestPermissionRows = false;