Mirror von
https://github.com/IntellectualSites/FastAsyncWorldEdit.git
synchronisiert 2024-11-20 09:50:06 +01:00
Improve block tracing performance
Dieser Commit ist enthalten in:
Ursprung
0f2d710fd0
Commit
002bb72e52
@ -3,7 +3,6 @@ package com.fastasyncworldedit.bukkit.util;
|
||||
import com.fastasyncworldedit.core.util.TaskManager;
|
||||
import com.sk89q.worldedit.bukkit.BukkitAdapter;
|
||||
import com.sk89q.worldedit.bukkit.WorldEditPlugin;
|
||||
import com.sk89q.worldedit.entity.Entity;
|
||||
import com.sk89q.worldedit.entity.Player;
|
||||
import com.sk89q.worldedit.util.Location;
|
||||
import org.bukkit.Bukkit;
|
||||
|
@ -10,6 +10,7 @@ import com.sk89q.worldedit.WorldEdit;
|
||||
import com.sk89q.worldedit.entity.Player;
|
||||
import com.sk89q.worldedit.extension.platform.PlayerProxy;
|
||||
import com.sk89q.worldedit.extent.Extent;
|
||||
import com.sk89q.worldedit.function.mask.Mask;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.math.Vector3;
|
||||
import com.sk89q.worldedit.util.Direction;
|
||||
@ -17,6 +18,7 @@ import com.sk89q.worldedit.util.Location;
|
||||
import com.sk89q.worldedit.util.TargetBlock;
|
||||
import com.sk89q.worldedit.world.World;
|
||||
import com.sk89q.worldedit.world.block.BlockTypes;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
public class AsyncPlayer extends PlayerProxy {
|
||||
|
||||
@ -177,19 +179,13 @@ public class AsyncPlayer extends PlayerProxy {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Location getBlockTrace(int range, boolean useLastBlock) {
|
||||
return TaskManager.taskManager().sync(() -> {
|
||||
TargetBlock tb = new TargetBlock(AsyncPlayer.this, range, 0.2D);
|
||||
return useLastBlock ? tb.getAnyTargetBlock() : tb.getTargetBlock();
|
||||
});
|
||||
public Location getBlockTrace(final int range, final boolean useLastBlock, @Nullable final Mask stopMask) {
|
||||
return TaskManager.taskManager().syncAt(() -> super.getBlockTrace(range, useLastBlock, stopMask), getLocation());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Location getBlockTraceFace(int range, boolean useLastBlock) {
|
||||
return TaskManager.taskManager().sync(() -> {
|
||||
TargetBlock tb = new TargetBlock(AsyncPlayer.this, range, 0.2D);
|
||||
return useLastBlock ? tb.getAnyTargetBlockFace() : tb.getTargetBlockFace();
|
||||
});
|
||||
public Location getBlockTraceFace(final int range, final boolean useLastBlock, @Nullable final Mask stopMask) {
|
||||
return TaskManager.taskManager().syncAt(() -> super.getBlockTraceFace(range, useLastBlock, stopMask), getLocation());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren