mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 16:37:43 +01:00
(EMC) add disable-give-dropping (#106)
This commit is contained in:
35
patches/server/0158-EMC-disable-give-dropping.patch
Normal file
35
patches/server/0158-EMC-disable-give-dropping.patch
Normal file
@@ -0,0 +1,35 @@
|
||||
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 patch by Aikar in EMC that allows /give's ability to drop items if the player's inventory is full via settings.disable-give-dropping in purpur.yml
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/CommandGive.java b/src/main/java/net/minecraft/server/CommandGive.java
|
||||
index 1d22c45af..9537ab1d8 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 c06f7dc24..a8f6c5f57 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;
|
||||
Reference in New Issue
Block a user