From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Aikar 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 a60a84d5df0b05cf35668df8c5f08b811bc42a9f..a2751744517634700131ccfb0a2617557b4d42f2 100644 --- a/src/main/java/net/minecraft/server/commands/GiveCommand.java +++ b/src/main/java/net/minecraft/server/commands/GiveCommand.java @@ -57,6 +57,7 @@ public class GiveCommand { boolean flag = entityplayer.getInventory().add(itemstack); ItemEntity entityitem; + if (org.purpurmc.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, false, false); // SPIGOT-2942: Add boolean to call event diff --git a/src/main/java/org/purpurmc/purpur/PurpurConfig.java b/src/main/java/org/purpurmc/purpur/PurpurConfig.java index e57dab3abf5162dbe77cb2ba89b2ebabeae3895d..bd4c8c087b5468e5cde5e2cc017ae6187aef51bb 100644 --- a/src/main/java/org/purpurmc/purpur/PurpurConfig.java +++ b/src/main/java/org/purpurmc/purpur/PurpurConfig.java @@ -207,6 +207,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;