mirror of
https://github.com/PlayPro/CoreProtect.git
synced 2024-11-28 12:55:34 +01:00
Skip extra checks on furnaces when processing hopper transactions
This more aggressively aborts transaction logging to improve performance
This commit is contained in:
parent
2f1c45cae1
commit
ae3768695f
@ -8,6 +8,7 @@ import java.util.Set;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.inventory.BrewerInventory;
|
||||
import org.bukkit.inventory.FurnaceInventory;
|
||||
import org.bukkit.inventory.Inventory;
|
||||
import org.bukkit.inventory.InventoryHolder;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
@ -50,7 +51,7 @@ public final class HopperPullListener {
|
||||
if (ConfigHandler.isPaper) {
|
||||
for (ItemStack itemStack : sourceHolder.getInventory().getContents()) {
|
||||
if (itemStack != null && Util.getItemStackHashCode(itemStack) == itemHash) {
|
||||
if (itemHash != Util.getItemStackHashCode(movedItem) || destinationHolder.getInventory().firstEmpty() == -1 || destinationHolder.getInventory() instanceof BrewerInventory) {
|
||||
if (itemHash != Util.getItemStackHashCode(movedItem) || destinationHolder.getInventory().firstEmpty() == -1 || destinationHolder.getInventory() instanceof BrewerInventory || destinationHolder.getInventory() instanceof FurnaceInventory) {
|
||||
abort = true;
|
||||
}
|
||||
|
||||
|
@ -8,6 +8,7 @@ import java.util.Set;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.inventory.BrewerInventory;
|
||||
import org.bukkit.inventory.FurnaceInventory;
|
||||
import org.bukkit.inventory.Inventory;
|
||||
import org.bukkit.inventory.InventoryHolder;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
@ -49,7 +50,7 @@ public final class HopperPushListener {
|
||||
if (ConfigHandler.isPaper) {
|
||||
for (ItemStack itemStack : sourceHolder.getInventory().getContents()) {
|
||||
if (itemStack != null && Util.getItemStackHashCode(itemStack) == itemHash) {
|
||||
if (itemHash != Util.getItemStackHashCode(movedItem) || destinationHolder.getInventory().firstEmpty() == -1 || destinationHolder.getInventory() instanceof BrewerInventory) {
|
||||
if (itemHash != Util.getItemStackHashCode(movedItem) || destinationHolder.getInventory().firstEmpty() == -1 || destinationHolder.getInventory() instanceof BrewerInventory || destinationHolder.getInventory() instanceof FurnaceInventory) {
|
||||
abort = true;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user