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/CommandGive.java b/src/main/java/net/minecraft/server/commands/CommandGive.java
index 6685bf1757458d908e32d4069f7a8a22a28c28d7..82d663d3b8bbbb020c3467ea93b54729c3053f9e 100644
--- a/src/main/java/net/minecraft/server/commands/CommandGive.java
+++ b/src/main/java/net/minecraft/server/commands/CommandGive.java
@@ -47,6 +47,7 @@ public class CommandGive {
                 boolean flag = entityplayer.inventory.pickup(itemstack);
                 EntityItem entityitem;
 
+                if (net.pl3x.purpur.PurpurConfig.disableGiveCommandDrops) continue; // Purpur - add config option for toggling give command dropping
                 if (flag && itemstack.isEmpty()) {
                     itemstack.setCount(1);
                     entityitem = entityplayer.drop(itemstack, false);
diff --git a/src/main/java/net/pl3x/purpur/PurpurConfig.java b/src/main/java/net/pl3x/purpur/PurpurConfig.java
index dc6122ef302055eb2c08fda05be977b045b6debe..f1088638716b4a02eb3b8541a040229da8a6ea24 100644
--- a/src/main/java/net/pl3x/purpur/PurpurConfig.java
+++ b/src/main/java/net/pl3x/purpur/PurpurConfig.java
@@ -193,6 +193,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;
