Files
MiraiMC/patches/server/0036-Do-not-drop-items-from-Give-command.patch
2021-12-10 22:19:30 +01:00

21 lines
1.3 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Etil <81570777+etil2jz@users.noreply.github.com>
Date: Fri, 10 Dec 2021 22:07:06 +0100
Subject: [PATCH] Do not drop items from Give command
Original code by Starlis, licensed under GNU General Public License v3.0
You can find the original code on https://github.com/starlis/empirecraft
diff --git a/src/main/java/net/minecraft/server/commands/GiveCommand.java b/src/main/java/net/minecraft/server/commands/GiveCommand.java
index a0dc380e90415de9068ea408d62a1605c82631df..be8380837c1ddcd5b27694de2d5c3a9a2760c093 100644
--- a/src/main/java/net/minecraft/server/commands/GiveCommand.java
+++ b/src/main/java/net/minecraft/server/commands/GiveCommand.java
@@ -45,6 +45,7 @@ public class GiveCommand {
k -= l;
ItemStack itemStack = item.createItemStack(l, false);
boolean bl = serverPlayer.getInventory().add(itemStack);
+ if (true) { continue; } // EMC - never drop items
if (bl && itemStack.isEmpty()) {
itemStack.setCount(1);
ItemEntity itemEntity2 = serverPlayer.drop(itemStack, false, false, true); // Paper - Fix duplicating /give items on item drop cancel