mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-18 08:57:44 +01:00
38 lines
1.8 KiB
Diff
38 lines
1.8 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
|
|
purur.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 1d22c45af8..9662a90156 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.giveCommandDrops) 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 c06f7dc24f..f4302410a1 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 giveCommandDrops = false;
|
|
+ private static void giveCommandDrops() {
|
|
+ giveCommandDrops = getBoolean("settings.disable-give-dropping", giveCommandDrops);
|
|
+ }
|
|
|
|
public static boolean barrelSixRows = false;
|
|
public static boolean enderChestSixRows = false;
|