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 06e3a868e922f1b7a586d0ca28f64a67ae463b68..32beb045f990d4da6112da4fea295333cb69e2ea 100644 --- a/src/main/java/net/minecraft/server/commands/GiveCommand.java +++ b/src/main/java/net/minecraft/server/commands/GiveCommand.java @@ -58,6 +58,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 94d62b88dcb6b98f3ad2e10eafa4ef782c825f4f..c4bdb9f2aab98d8915f4079f4815c10f97334f71 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;