mirror of
https://github.com/PaperMC/Paper.git
synced 2025-02-01 04:23:37 +01:00
Updated Upstream (CraftBukkit) (#5762)
Upstream has released updates that appear to apply and compile correctly. This update has not been tested by PaperMC and as with ANY update, please do your own testing CraftBukkit Changes: 90a4d64a Remove usage of Java 11 method not caught by animal sniffer c51c0f7f SPIGOT-6483: Fix cancelling EntityPickupEvent for villagers
This commit is contained in:
parent
14216d1a4f
commit
bb5486d372
2 changed files with 1 additions and 43 deletions
|
@ -1,42 +0,0 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: BillyGalbreath <blake.galbreath@gmail.com>
|
||||
Date: Fri, 28 May 2021 06:48:48 -0500
|
||||
Subject: [PATCH] Reset villager inventory on cancelled pickup event
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/InventorySubcontainer.java b/src/main/java/net/minecraft/world/InventorySubcontainer.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/world/InventorySubcontainer.java
|
||||
+++ b/src/main/java/net/minecraft/world/InventorySubcontainer.java
|
||||
@@ -0,0 +0,0 @@ public class InventorySubcontainer implements IInventory, AutoRecipeOutput {
|
||||
return this.items;
|
||||
}
|
||||
|
||||
+ // Paper start
|
||||
+ public void setContents(List<ItemStack> items) {
|
||||
+ this.items.clear();
|
||||
+ for(int i = 0; i < items.size(); i++) {
|
||||
+ this.items.set(i, items.get(i));
|
||||
+ }
|
||||
+ this.update();
|
||||
+ }
|
||||
+ // Paper end
|
||||
+
|
||||
public void onOpen(CraftHumanEntity who) {
|
||||
transaction.add(who);
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/npc/EntityVillager.java b/src/main/java/net/minecraft/world/entity/npc/EntityVillager.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/npc/EntityVillager.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/npc/EntityVillager.java
|
||||
@@ -0,0 +0,0 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation
|
||||
}
|
||||
|
||||
// CraftBukkit start
|
||||
+ List<ItemStack> contentsSnapshot = new java.util.ArrayList<>(inventorysubcontainer.getContents()); // Paper
|
||||
ItemStack itemstack1 = inventorysubcontainer.a(itemstack);
|
||||
if (CraftEventFactory.callEntityPickupItemEvent(this, entityitem, itemstack1.getCount(), false).isCancelled()) {
|
||||
+ inventorysubcontainer.setContents(contentsSnapshot); // Paper
|
||||
return;
|
||||
}
|
||||
// CraftBukkit end
|
|
@ -1 +1 @@
|
|||
Subproject commit 769a579cb0f61467b3ce0e0ae0e5a2bff352f524
|
||||
Subproject commit 90a4d64a9a73ab46cf7a87ddd86bf5795154dad9
|
Loading…
Add table
Reference in a new issue