mirror of
https://github.com/PlayPro/CoreProtect.git
synced 2024-11-28 12:55:34 +01:00
Moved inventory checkTasks to directly before onInventoryInteract
This improves performance (allows unused threads to return faster), and resolves issues with pass-through transactions
This commit is contained in:
parent
6fce87386d
commit
2f1c45cae1
@ -39,7 +39,6 @@ public final class HopperPullListener {
|
||||
final long taskStarted = InventoryChangeListener.tasksStarted.incrementAndGet();
|
||||
Bukkit.getServer().getScheduler().runTaskAsynchronously(CoreProtect.getInstance(), () -> {
|
||||
try {
|
||||
InventoryChangeListener.checkTasks(taskStarted);
|
||||
if (sourceHolder == null || destinationHolder == null) {
|
||||
return;
|
||||
}
|
||||
@ -133,6 +132,7 @@ public final class HopperPullListener {
|
||||
}
|
||||
|
||||
originalSource[inventoryContents.length] = movedItem;
|
||||
InventoryChangeListener.checkTasks(taskStarted);
|
||||
InventoryChangeListener.onInventoryInteract("#hopper", sourceInventory, originalSource, null, sourceInventory.getLocation(), true);
|
||||
}
|
||||
catch (Exception e) {
|
||||
|
@ -39,7 +39,6 @@ public final class HopperPushListener {
|
||||
final long taskStarted = InventoryChangeListener.tasksStarted.incrementAndGet();
|
||||
Bukkit.getServer().getScheduler().runTaskAsynchronously(CoreProtect.getInstance(), () -> {
|
||||
try {
|
||||
InventoryChangeListener.checkTasks(taskStarted);
|
||||
if (sourceHolder == null || destinationHolder == null) {
|
||||
return;
|
||||
}
|
||||
@ -110,6 +109,7 @@ public final class HopperPushListener {
|
||||
}
|
||||
}
|
||||
|
||||
InventoryChangeListener.checkTasks(taskStarted);
|
||||
InventoryChangeListener.onInventoryInteract("#hopper", destinationInventory, originalDestination, null, destinationInventory.getLocation(), true);
|
||||
}
|
||||
catch (Exception e) {
|
||||
|
@ -227,8 +227,8 @@ public final class InventoryChangeListener extends Queue implements Listener {
|
||||
final long taskStarted = InventoryChangeListener.tasksStarted.incrementAndGet();
|
||||
Bukkit.getServer().getScheduler().runTaskAsynchronously(CoreProtect.getInstance(), () -> {
|
||||
try {
|
||||
InventoryChangeListener.checkTasks(taskStarted);
|
||||
Material containerType = (enderChest != true ? null : Material.ENDER_CHEST);
|
||||
InventoryChangeListener.checkTasks(taskStarted);
|
||||
onInventoryInteract(player.getName(), inventory, containerState, containerType, inventoryLocation, true);
|
||||
}
|
||||
catch (Exception e) {
|
||||
|
Loading…
Reference in New Issue
Block a user