mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-22 08:57:35 +01:00
[Auto] Updated Upstream (CraftBukkit)
Upstream has released updates that appears 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:
e4183e70
SPIGOT-4491: Fix InventoryMoveItemEvent causing repeated events
This commit is contained in:
parent
975491cb8b
commit
8cd849c64d
@ -1,4 +1,4 @@
|
|||||||
From b8f8ff8c81c3a92ae48adb86b8decabe0d11a702 Mon Sep 17 00:00:00 2001
|
From 0e1052315579d6638c1e893e288cf325ab05d1c7 Mon Sep 17 00:00:00 2001
|
||||||
From: Aikar <aikar@aikar.co>
|
From: Aikar <aikar@aikar.co>
|
||||||
Date: Wed, 27 Apr 2016 22:09:52 -0400
|
Date: Wed, 27 Apr 2016 22:09:52 -0400
|
||||||
Subject: [PATCH] Optimize Hoppers
|
Subject: [PATCH] Optimize Hoppers
|
||||||
@ -11,7 +11,7 @@ Subject: [PATCH] Optimize Hoppers
|
|||||||
* Skip subsequent InventoryMoveItemEvents if a plugin does not use the item after first event fire for an iteration
|
* Skip subsequent InventoryMoveItemEvents if a plugin does not use the item after first event fire for an iteration
|
||||||
|
|
||||||
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||||
index 31b2c71960..d818d39039 100644
|
index 95fc2d8ed..ac07bcc75 100644
|
||||||
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||||
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||||
@@ -415,6 +415,15 @@ public class PaperWorldConfig {
|
@@ -415,6 +415,15 @@ public class PaperWorldConfig {
|
||||||
@ -31,7 +31,7 @@ index 31b2c71960..d818d39039 100644
|
|||||||
private void disableSprintInterruptionOnAttack() {
|
private void disableSprintInterruptionOnAttack() {
|
||||||
disableSprintInterruptionOnAttack = getBoolean("game-mechanics.disable-sprint-interruption-on-attack", false);
|
disableSprintInterruptionOnAttack = getBoolean("game-mechanics.disable-sprint-interruption-on-attack", false);
|
||||||
diff --git a/src/main/java/net/minecraft/server/ItemStack.java b/src/main/java/net/minecraft/server/ItemStack.java
|
diff --git a/src/main/java/net/minecraft/server/ItemStack.java b/src/main/java/net/minecraft/server/ItemStack.java
|
||||||
index 9326eaa2a9..4641113f9d 100644
|
index 36c8644e2..eea6d9419 100644
|
||||||
--- a/src/main/java/net/minecraft/server/ItemStack.java
|
--- a/src/main/java/net/minecraft/server/ItemStack.java
|
||||||
+++ b/src/main/java/net/minecraft/server/ItemStack.java
|
+++ b/src/main/java/net/minecraft/server/ItemStack.java
|
||||||
@@ -459,8 +459,9 @@ public final class ItemStack {
|
@@ -459,8 +459,9 @@ public final class ItemStack {
|
||||||
@ -47,7 +47,7 @@ index 9326eaa2a9..4641113f9d 100644
|
|||||||
itemstack.d(this.B());
|
itemstack.d(this.B());
|
||||||
if (this.tag != null) {
|
if (this.tag != null) {
|
||||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
index 6fa54386e8..eb3fc836fb 100644
|
index 116620984..d83e85dbf 100644
|
||||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
@@ -1050,7 +1050,8 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati
|
@@ -1050,7 +1050,8 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati
|
||||||
@ -61,7 +61,7 @@ index 6fa54386e8..eb3fc836fb 100644
|
|||||||
if (true || worldserver.worldProvider.getDimensionManager() == DimensionManager.OVERWORLD || this.getAllowNether()) { // CraftBukkit
|
if (true || worldserver.worldProvider.getDimensionManager() == DimensionManager.OVERWORLD || this.getAllowNether()) { // CraftBukkit
|
||||||
this.methodProfiler.a(() -> {
|
this.methodProfiler.a(() -> {
|
||||||
diff --git a/src/main/java/net/minecraft/server/TileEntity.java b/src/main/java/net/minecraft/server/TileEntity.java
|
diff --git a/src/main/java/net/minecraft/server/TileEntity.java b/src/main/java/net/minecraft/server/TileEntity.java
|
||||||
index 29fe031d85..d67fd92d9d 100644
|
index 29fe031d8..d67fd92d9 100644
|
||||||
--- a/src/main/java/net/minecraft/server/TileEntity.java
|
--- a/src/main/java/net/minecraft/server/TileEntity.java
|
||||||
+++ b/src/main/java/net/minecraft/server/TileEntity.java
|
+++ b/src/main/java/net/minecraft/server/TileEntity.java
|
||||||
@@ -52,6 +52,7 @@ public abstract class TileEntity implements KeyedObject { // Paper
|
@@ -52,6 +52,7 @@ public abstract class TileEntity implements KeyedObject { // Paper
|
||||||
@ -81,7 +81,7 @@ index 29fe031d85..d67fd92d9d 100644
|
|||||||
this.world.b(this.position, this);
|
this.world.b(this.position, this);
|
||||||
if (!this.f.isAir()) {
|
if (!this.f.isAir()) {
|
||||||
diff --git a/src/main/java/net/minecraft/server/TileEntityHopper.java b/src/main/java/net/minecraft/server/TileEntityHopper.java
|
diff --git a/src/main/java/net/minecraft/server/TileEntityHopper.java b/src/main/java/net/minecraft/server/TileEntityHopper.java
|
||||||
index 5ba009c7cf..a8cf160fe4 100644
|
index b36ec46bf..10e18bf34 100644
|
||||||
--- a/src/main/java/net/minecraft/server/TileEntityHopper.java
|
--- a/src/main/java/net/minecraft/server/TileEntityHopper.java
|
||||||
+++ b/src/main/java/net/minecraft/server/TileEntityHopper.java
|
+++ b/src/main/java/net/minecraft/server/TileEntityHopper.java
|
||||||
@@ -190,6 +190,154 @@ public class TileEntityHopper extends TileEntityLootable implements IHopper, ITi
|
@@ -190,6 +190,154 @@ public class TileEntityHopper extends TileEntityLootable implements IHopper, ITi
|
||||||
@ -247,7 +247,7 @@ index 5ba009c7cf..a8cf160fe4 100644
|
|||||||
for (int i = 0; i < this.getSize(); ++i) {
|
for (int i = 0; i < this.getSize(); ++i) {
|
||||||
if (!this.getItem(i).isEmpty()) {
|
if (!this.getItem(i).isEmpty()) {
|
||||||
ItemStack itemstack = this.getItem(i).cloneItemStack();
|
ItemStack itemstack = this.getItem(i).cloneItemStack();
|
||||||
@@ -242,7 +391,7 @@ public class TileEntityHopper extends TileEntityLootable implements IHopper, ITi
|
@@ -238,7 +387,7 @@ public class TileEntityHopper extends TileEntityLootable implements IHopper, ITi
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -256,7 +256,7 @@ index 5ba009c7cf..a8cf160fe4 100644
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -313,6 +462,7 @@ public class TileEntityHopper extends TileEntityLootable implements IHopper, ITi
|
@@ -309,6 +458,7 @@ public class TileEntityHopper extends TileEntityLootable implements IHopper, ITi
|
||||||
if (b(iinventory, enumdirection)) {
|
if (b(iinventory, enumdirection)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -264,7 +264,7 @@ index 5ba009c7cf..a8cf160fe4 100644
|
|||||||
|
|
||||||
if (iinventory instanceof IWorldInventory) {
|
if (iinventory instanceof IWorldInventory) {
|
||||||
IWorldInventory iworldinventory = (IWorldInventory) iinventory;
|
IWorldInventory iworldinventory = (IWorldInventory) iinventory;
|
||||||
@@ -355,6 +505,7 @@ public class TileEntityHopper extends TileEntityLootable implements IHopper, ITi
|
@@ -351,6 +501,7 @@ public class TileEntityHopper extends TileEntityLootable implements IHopper, ITi
|
||||||
ItemStack itemstack = iinventory.getItem(i);
|
ItemStack itemstack = iinventory.getItem(i);
|
||||||
|
|
||||||
if (!itemstack.isEmpty() && b(iinventory, itemstack, i, enumdirection)) {
|
if (!itemstack.isEmpty() && b(iinventory, itemstack, i, enumdirection)) {
|
||||||
@ -272,7 +272,7 @@ index 5ba009c7cf..a8cf160fe4 100644
|
|||||||
ItemStack itemstack1 = itemstack.cloneItemStack();
|
ItemStack itemstack1 = itemstack.cloneItemStack();
|
||||||
// ItemStack itemstack2 = addItem(iinventory, ihopper, iinventory.splitStack(i, 1), (EnumDirection) null);
|
// ItemStack itemstack2 = addItem(iinventory, ihopper, iinventory.splitStack(i, 1), (EnumDirection) null);
|
||||||
// CraftBukkit start - Call event on collection of items from inventories into the hopper
|
// CraftBukkit start - Call event on collection of items from inventories into the hopper
|
||||||
@@ -395,7 +546,7 @@ public class TileEntityHopper extends TileEntityLootable implements IHopper, ITi
|
@@ -387,7 +538,7 @@ public class TileEntityHopper extends TileEntityLootable implements IHopper, ITi
|
||||||
}
|
}
|
||||||
|
|
||||||
itemstack1.subtract(origCount - itemstack2.getCount()); // Spigot
|
itemstack1.subtract(origCount - itemstack2.getCount()); // Spigot
|
||||||
@ -281,7 +281,7 @@ index 5ba009c7cf..a8cf160fe4 100644
|
|||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
@@ -404,7 +555,7 @@ public class TileEntityHopper extends TileEntityLootable implements IHopper, ITi
|
@@ -396,7 +547,7 @@ public class TileEntityHopper extends TileEntityLootable implements IHopper, ITi
|
||||||
public static boolean a(IInventory iinventory, EntityItem entityitem) {
|
public static boolean a(IInventory iinventory, EntityItem entityitem) {
|
||||||
boolean flag = false;
|
boolean flag = false;
|
||||||
// CraftBukkit start
|
// CraftBukkit start
|
||||||
@ -290,7 +290,7 @@ index 5ba009c7cf..a8cf160fe4 100644
|
|||||||
entityitem.world.getServer().getPluginManager().callEvent(event);
|
entityitem.world.getServer().getPluginManager().callEvent(event);
|
||||||
if (event.isCancelled()) {
|
if (event.isCancelled()) {
|
||||||
return false;
|
return false;
|
||||||
@@ -458,7 +609,9 @@ public class TileEntityHopper extends TileEntityLootable implements IHopper, ITi
|
@@ -450,7 +601,9 @@ public class TileEntityHopper extends TileEntityLootable implements IHopper, ITi
|
||||||
boolean flag1 = iinventory1.P_();
|
boolean flag1 = iinventory1.P_();
|
||||||
|
|
||||||
if (itemstack1.isEmpty()) {
|
if (itemstack1.isEmpty()) {
|
||||||
@ -301,5 +301,5 @@ index 5ba009c7cf..a8cf160fe4 100644
|
|||||||
flag = true;
|
flag = true;
|
||||||
} else if (a(itemstack1, itemstack)) {
|
} else if (a(itemstack1, itemstack)) {
|
||||||
--
|
--
|
||||||
2.19.0
|
2.19.1
|
||||||
|
|
||||||
|
@ -1 +1 @@
|
|||||||
Subproject commit 1cac9d4fc1263efb19140b808ec8671d3e3bfc5e
|
Subproject commit e4183e7069107a8e2bdb9b1d3f30a663e27614d3
|
Loading…
Reference in New Issue
Block a user