mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2024-12-31 21:48:28 +01:00
Use updated PaperLib for InventoryHolder optimisation
This commit is contained in:
parent
20044a72d3
commit
46dfb69fb1
@ -35,7 +35,7 @@
|
||||
"api"("com.sk89q.worldedit:worldedit-bukkit:${Versions.WORLDEDIT}") { isTransitive = false }
|
||||
"implementation"("com.google.guava:guava:${Versions.GUAVA}")
|
||||
"compileOnly"("com.sk89q:commandbook:2.3") { isTransitive = false }
|
||||
"shadeOnly"("io.papermc:paperlib:1.0.7")
|
||||
"shadeOnly"("io.papermc:paperlib:1.0.8")
|
||||
"shadeOnly"("org.bstats:bstats-bukkit:3.0.0")
|
||||
"shadeOnly"("co.aikar:minecraft-timings:1.0.4")
|
||||
}
|
||||
|
@ -22,8 +22,6 @@
|
||||
import static com.sk89q.worldguard.bukkit.cause.Cause.create;
|
||||
|
||||
import com.destroystokyo.paper.event.entity.EntityZapEvent;
|
||||
import com.sk89q.worldedit.bukkit.BukkitAdapter;
|
||||
import com.sk89q.worldguard.bukkit.BukkitWorldConfiguration;
|
||||
import com.sk89q.worldguard.bukkit.WorldGuardPlugin;
|
||||
import com.sk89q.worldguard.bukkit.cause.Cause;
|
||||
import com.sk89q.worldguard.bukkit.event.DelegateEvent;
|
||||
@ -142,7 +140,6 @@
|
||||
import org.bukkit.event.vehicle.VehicleDestroyEvent;
|
||||
import org.bukkit.event.world.StructureGrowEvent;
|
||||
import org.bukkit.inventory.EquipmentSlot;
|
||||
import org.bukkit.inventory.Inventory;
|
||||
import org.bukkit.inventory.InventoryHolder;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.plugin.PluginManager;
|
||||
@ -952,12 +949,7 @@ public void onInventoryOpen(InventoryOpenEvent event) {
|
||||
|
||||
@EventHandler(ignoreCancelled = true)
|
||||
public void onInventoryMoveItem(InventoryMoveItemEvent event) {
|
||||
InventoryHolder causeHolder;
|
||||
if (PaperLib.isPaper()) {
|
||||
causeHolder = event.getInitiator().getHolder(false);
|
||||
} else {
|
||||
causeHolder = event.getInitiator().getHolder();
|
||||
}
|
||||
InventoryHolder causeHolder = PaperLib.getHolder(event.getInitiator(), false).getHolder();
|
||||
|
||||
WorldConfiguration wcfg = null;
|
||||
if (causeHolder instanceof Hopper
|
||||
@ -971,15 +963,8 @@ public void onInventoryMoveItem(InventoryMoveItemEvent event) {
|
||||
Entry entry;
|
||||
|
||||
if ((entry = moveItemDebounce.tryDebounce(event)) != null) {
|
||||
InventoryHolder sourceHolder;
|
||||
InventoryHolder targetHolder;
|
||||
if (PaperLib.isPaper()) {
|
||||
sourceHolder = event.getSource().getHolder(false);
|
||||
targetHolder = event.getDestination().getHolder(false);
|
||||
} else {
|
||||
sourceHolder = event.getSource().getHolder();
|
||||
targetHolder = event.getDestination().getHolder();
|
||||
}
|
||||
InventoryHolder sourceHolder = PaperLib.getHolder(event.getSource(), false).getHolder();
|
||||
InventoryHolder targetHolder = PaperLib.getHolder(event.getDestination(), false).getHolder();
|
||||
|
||||
Cause cause;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user