mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-19 17:37:42 +01:00
Dropped per the advice of Proximyst. Has possible issues if players log in while they are still logging out from another location, with increased risk during lag spikes. A fix/workaround is possible in the future, but for the time being we will just drop this patch to avoid any potential problems.
38 lines
2.0 KiB
Diff
38 lines
2.0 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/CommandGive.java b/src/main/java/net/minecraft/server/CommandGive.java
|
|
index 1d22c45af884a917e77e02c272fcbae74794200c..7bf90f27fdc48440ef229cca0e100d2c5c0ebef7 100644
|
|
--- a/src/main/java/net/minecraft/server/CommandGive.java
|
|
+++ b/src/main/java/net/minecraft/server/CommandGive.java
|
|
@@ -35,6 +35,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 0c1f22249061f600fce2d4d627f0683f461977ba..4ea4abc4f03123fa4be7e19b777d4afa0d2002ae 100644
|
|
--- a/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
|
+++ b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
|
@@ -188,6 +188,11 @@ public class PurpurConfig {
|
|
private static void useAlternateKeepAlive() {
|
|
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;
|