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

Paper Changes:
05cb10c56f Add repo for Velocity natives to dev bundle (#6536)
7bd7b18811 Configurable feature seeds (#6531)
ca708a0944 Updated Upstream (Bukkit/CraftBukkit/Spigot) (#6539)
f02d3d8989 flattener should try to render custom translations (#6540)
1276bd5039 Fixed layers from V2550 not being added to list (#6541)
a763f258da docs: remove Paper tool method for patch mods
20903fcf5e docs: drop table of contents; it's built into GH
2021-09-02 12:13:11 -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 af299caa01193a6fa76656814164b0c5fbeec350..8323b10a6ab17f56c6e5d1ad2cee9ebc7ad403de 100644
--- a/src/main/java/net/pl3x/purpur/PurpurConfig.java
+++ b/src/main/java/net/pl3x/purpur/PurpurConfig.java
@@ -204,6 +204,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 int barrelRows = 3;
public static boolean enderChestSixRows = false;
public static boolean enderChestPermissionRows = false;