This commit is contained in:
Aurora
2020-07-26 19:03:46 +02:00
608 changed files with 4704 additions and 3740 deletions

View File

@ -27,7 +27,7 @@ import org.slf4j.LoggerFactory;
import java.io.File;
/**
* YAMLConfiguration but with setting for no op permissions and plugin root data folder
* YAMLConfiguration but with setting for no op permissions and plugin root data folder.
*/
public class BukkitConfiguration extends YAMLConfiguration {
@ -59,8 +59,8 @@ public class BukkitConfiguration extends YAMLConfiguration {
File toDir = new File(getWorkingDirectory(), file);
if (fromDir.exists() & !toDir.exists()) {
if (fromDir.renameTo(toDir)) {
plugin.getLogger().info("Migrated " + name + " folder '" + file +
"' from server root to plugin data folder.");
plugin.getLogger().info("Migrated " + name + " folder '" + file
+ "' from server root to plugin data folder.");
} else {
plugin.getLogger().warning("Error while migrating " + name + " folder!");
}

View File

@ -19,9 +19,6 @@
package com.sk89q.worldedit.bukkit;
import static com.google.common.base.Preconditions.checkNotNull;
import com.boydti.fawe.util.TaskManager;
import com.sk89q.worldedit.bukkit.adapter.BukkitImplAdapter;
import com.sk89q.worldedit.entity.BaseEntity;
import com.sk89q.worldedit.entity.Entity;
@ -35,9 +32,10 @@ import org.bukkit.entity.EntityType;
import java.lang.ref.WeakReference;
import java.util.Locale;
import javax.annotation.Nullable;
import static com.google.common.base.Preconditions.checkNotNull;
/**
* An adapter to adapt a Bukkit entity into a WorldEdit one.
*/

View File

@ -194,7 +194,7 @@ public class BukkitPlayer extends AbstractPlayerActor {
}
@Override
public void setPosition(Vector3 pos, float pitch, float yaw) {
public boolean trySetPosition(Vector3 pos, float pitch, float yaw) {
org.bukkit.World world = player.getWorld();
if (pos instanceof com.sk89q.worldedit.util.Location) {
com.sk89q.worldedit.util.Location loc = (com.sk89q.worldedit.util.Location) pos;
@ -203,7 +203,8 @@ public class BukkitPlayer extends AbstractPlayerActor {
world = Bukkit.getWorld(((World) extent).getName());
}
}
player.teleport(new Location(world, pos.getX(), pos.getY(), pos.getZ(), yaw, pitch));
org.bukkit.World finalWorld = world;
return TaskManager.IMP.sync(() -> player.teleport(new Location(finalWorld, pos.getX(), pos.getY(), pos.getZ(), yaw, pitch)));
}
@Override

View File

@ -406,10 +406,11 @@ public final class FAWE_Spigot_v1_14_R4 extends CachedBukkitAdapter implements I
SingleThreadQueueExtent extent = new SingleThreadQueueExtent();
extent.init(null, (x, z) -> new BukkitGetBlocks_1_14(freshWorld, x, z) {
@Override
public Chunk ensureLoaded(World nmsWorld, int X, int Z) {
Chunk cached = nmsWorld.getChunkIfLoaded(X, Z);
public Chunk ensureLoaded(World nmsWorld, int chunkX, int chunkZ) {
Chunk cached = nmsWorld.getChunkIfLoaded(chunkX, chunkZ);
if (cached != null) return cached;
Future<Chunk> future = Fawe.get().getQueueHandler().sync((Supplier<Chunk>) () -> freshWorld.getChunkAt(X, Z));
Future<Chunk> future = Fawe.get().getQueueHandler().sync((Supplier<Chunk>) () -> freshWorld.getChunkAt(
chunkX, chunkZ));
while (!future.isDone()) {
// this feels so dirty
freshWorld.getChunkProvider().runTasks();