mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-29 15:49:00 +01:00
Update Upstream
This commit is contained in:
parent
ce5c1499f2
commit
489fda430a
3 changed files with 15 additions and 6 deletions
|
@ -5,7 +5,7 @@ Subject: [PATCH] PlayerPickupItemEvent#setFlyAtPlayer
|
||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/org/bukkit/event/player/PlayerPickupItemEvent.java b/src/main/java/org/bukkit/event/player/PlayerPickupItemEvent.java
|
diff --git a/src/main/java/org/bukkit/event/player/PlayerPickupItemEvent.java b/src/main/java/org/bukkit/event/player/PlayerPickupItemEvent.java
|
||||||
index 29f03f5d..da19009b 100644
|
index c76f423e..46c6d519 100644
|
||||||
--- a/src/main/java/org/bukkit/event/player/PlayerPickupItemEvent.java
|
--- a/src/main/java/org/bukkit/event/player/PlayerPickupItemEvent.java
|
||||||
+++ b/src/main/java/org/bukkit/event/player/PlayerPickupItemEvent.java
|
+++ b/src/main/java/org/bukkit/event/player/PlayerPickupItemEvent.java
|
||||||
@@ -0,0 +0,0 @@ import org.bukkit.event.entity.EntityPickupItemEvent;
|
@@ -0,0 +0,0 @@ import org.bukkit.event.entity.EntityPickupItemEvent;
|
||||||
|
|
|
@ -5,7 +5,7 @@ Subject: [PATCH] Fix Recipe Books
|
||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
|
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||||
index 682211cdd..5b9021939 100644
|
index 682211cdd..034081cbe 100644
|
||||||
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
|
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||||
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
|
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||||
@@ -0,0 +0,0 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable {
|
@@ -0,0 +0,0 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable {
|
||||||
|
@ -27,13 +27,22 @@ index 682211cdd..5b9021939 100644
|
||||||
itemstack = this.player.activeContainer.getSlot(packetplayinautorecipe_a.b).getItem();
|
itemstack = this.player.activeContainer.getSlot(packetplayinautorecipe_a.b).getItem();
|
||||||
- if (this.a(packetplayinautorecipe_a.a, itemstack)) {
|
- if (this.a(packetplayinautorecipe_a.a, itemstack)) {
|
||||||
+ // Paper start - improve validation
|
+ // Paper start - improve validation
|
||||||
+ ItemStack to = this.player.inventory.getItem(packetplayinautorecipe_a.c);
|
+ int toSlot = packetplayinautorecipe_a.c;
|
||||||
|
+ ItemStack to = toSlot != -1 ? this.player.inventory.getItem(toSlot) : ItemStack.a;
|
||||||
+ ItemStack ref = packetplayinautorecipe_a.a;
|
+ ItemStack ref = packetplayinautorecipe_a.a;
|
||||||
+ if (this.a(ref, itemstack) && (to.isEmpty() || this.a(ref, to)) && (ref.getCount() + to.getCount() <= ref.getMaxStackSize())) {
|
+ if (this.a(ref, itemstack) && (to.isEmpty() || this.a(ref, to)) && (ref.getCount() + to.getCount() <= ref.getMaxStackSize())) {
|
||||||
+ // Paper end
|
+ // Paper end
|
||||||
i = packetplayinautorecipe_a.a.getCount();
|
i = packetplayinautorecipe_a.a.getCount();
|
||||||
if (packetplayinautorecipe_a.c == -1) {
|
if (packetplayinautorecipe_a.c == -1) {
|
||||||
this.player.drop(packetplayinautorecipe_a.a, true);
|
- this.player.drop(packetplayinautorecipe_a.a, true);
|
||||||
|
+ // Paper start
|
||||||
|
+ this.player.drop(itemstack, true);
|
||||||
|
+ this.player.activeContainer.setItem(packetplayinautorecipe_a.b, ItemStack.a);
|
||||||
|
+ continue;
|
||||||
|
+ // Paper end
|
||||||
|
} else {
|
||||||
|
ItemStack itemstack1 = this.player.inventory.getItem(packetplayinautorecipe_a.c);
|
||||||
|
|
||||||
@@ -0,0 +0,0 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable {
|
@@ -0,0 +0,0 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable {
|
||||||
itemstack.subtract(i);
|
itemstack.subtract(i);
|
||||||
}
|
}
|
||||||
|
@ -55,7 +64,7 @@ index 682211cdd..5b9021939 100644
|
||||||
+ // Paper start
|
+ // Paper start
|
||||||
+ ItemStack ref = packetplayinautorecipe_a.a;
|
+ ItemStack ref = packetplayinautorecipe_a.a;
|
||||||
+ ItemStack to = this.player.activeContainer.getSlot(packetplayinautorecipe_a.b).getItem();
|
+ ItemStack to = this.player.activeContainer.getSlot(packetplayinautorecipe_a.b).getItem();
|
||||||
+ if (this.a(ref, itemstack) && (ref.getCount() + to.getCount() <= ref.getMaxStackSize())) {
|
+ if (this.a(ref, itemstack) && (to.isEmpty() || this.a(ref, to)) && (ref.getCount() + to.getCount() <= ref.getMaxStackSize())) {
|
||||||
+ // Paper end
|
+ // Paper end
|
||||||
i = packetplayinautorecipe_a.a.getCount();
|
i = packetplayinautorecipe_a.a.getCount();
|
||||||
if (itemstack.getCount() == i) {
|
if (itemstack.getCount() == i) {
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit a4b56a40cf4830115938b1caf9e33c087edefd2d
|
Subproject commit 0ce77bc4b3825b1665b34f7dd6dc4b01a02e9443
|
Loading…
Reference in a new issue