Mirror von
https://github.com/IntellectualSites/FastAsyncWorldEdit.git
synchronisiert 2024-12-24 18:10:08 +01:00
Add paper methods to AsyncWorld
Dieser Commit ist enthalten in:
Ursprung
6a7935829b
Commit
de52b65738
@ -1,6 +1,5 @@
|
|||||||
package com.boydti.fawe.bukkit.wrapper;
|
package com.boydti.fawe.bukkit.wrapper;
|
||||||
|
|
||||||
import com.avaje.ebean.validation.NotNull;
|
|
||||||
import com.boydti.fawe.FaweAPI;
|
import com.boydti.fawe.FaweAPI;
|
||||||
import com.boydti.fawe.bukkit.v0.BukkitQueue_0;
|
import com.boydti.fawe.bukkit.v0.BukkitQueue_0;
|
||||||
import com.boydti.fawe.object.FaweQueue;
|
import com.boydti.fawe.object.FaweQueue;
|
||||||
@ -29,6 +28,7 @@ import org.bukkit.*;
|
|||||||
import org.bukkit.block.Biome;
|
import org.bukkit.block.Biome;
|
||||||
import org.bukkit.block.Block;
|
import org.bukkit.block.Block;
|
||||||
import org.bukkit.block.data.BlockData;
|
import org.bukkit.block.data.BlockData;
|
||||||
|
import org.bukkit.entity.AbstractArrow;
|
||||||
import org.bukkit.entity.Arrow;
|
import org.bukkit.entity.Arrow;
|
||||||
import org.bukkit.entity.Entity;
|
import org.bukkit.entity.Entity;
|
||||||
import org.bukkit.entity.EntityType;
|
import org.bukkit.entity.EntityType;
|
||||||
@ -47,6 +47,7 @@ import org.bukkit.util.BoundingBox;
|
|||||||
import org.bukkit.util.Consumer;
|
import org.bukkit.util.Consumer;
|
||||||
import org.bukkit.util.RayTraceResult;
|
import org.bukkit.util.RayTraceResult;
|
||||||
import org.bukkit.util.Vector;
|
import org.bukkit.util.Vector;
|
||||||
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Modify the world from an async thread<br>
|
* Modify the world from an async thread<br>
|
||||||
@ -444,8 +445,8 @@ public class AsyncWorld extends DelegateFaweQueue implements World, HasFaweQueue
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public <T extends Arrow> T spawnArrow(Location location, Vector vector, float v, float v1, Class<T> aClass) {
|
public <T extends AbstractArrow> @NotNull T spawnArrow(@NotNull Location location, @NotNull Vector direction, float speed, float spread, @NotNull Class<T> clazz) {
|
||||||
return parent.spawnArrow(location, vector, v, v1, aClass);
|
return parent.spawnArrow(location, direction, speed, spread, clazz);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -1167,128 +1168,110 @@ public class AsyncWorld extends DelegateFaweQueue implements World, HasFaweQueue
|
|||||||
return parent.getForceLoadedChunks();
|
return parent.getForceLoadedChunks();
|
||||||
}
|
}
|
||||||
|
|
||||||
// @Override
|
@Override
|
||||||
// public int getHighestBlockYAt(int x, int z, com.destroystokyo.paper.HeightmapType heightmap) throws UnsupportedOperationException {
|
public int getHighestBlockYAt(int x, int z, com.destroystokyo.paper.HeightmapType heightmap) throws UnsupportedOperationException {
|
||||||
// return TaskManager.IMP.sync(new Supplier<Integer>() {
|
return TaskManager.IMP.sync(new Supplier<Integer>() {
|
||||||
// @Override
|
@Override
|
||||||
// public Integer get() {
|
public Integer get() {
|
||||||
// return parent.getHighestBlockYAt(x, z, heightmap);
|
return parent.getHighestBlockYAt(x, z, heightmap);
|
||||||
// }
|
}
|
||||||
// });
|
});
|
||||||
// }
|
}
|
||||||
//
|
|
||||||
// @Override
|
@Override
|
||||||
// public int getEntityCount() {
|
public int getEntityCount() {
|
||||||
// return TaskManager.IMP.sync(new RunnableVal<Integer>() {
|
return TaskManager.IMP.sync(new RunnableVal<Integer>() {
|
||||||
// @Override
|
@Override
|
||||||
// public void run(Integer value) {
|
public void run(Integer value) {
|
||||||
// this.value = parent.getEntityCount();
|
this.value = parent.getEntityCount();
|
||||||
// }
|
}
|
||||||
// });
|
});
|
||||||
// }
|
}
|
||||||
//
|
|
||||||
// @Override
|
@Override
|
||||||
// public int getTileEntityCount() {
|
public int getTileEntityCount() {
|
||||||
// return TaskManager.IMP.sync(new RunnableVal<Integer>() {
|
return TaskManager.IMP.sync(new RunnableVal<Integer>() {
|
||||||
// @Override
|
@Override
|
||||||
// public void run(Integer value) {
|
public void run(Integer value) {
|
||||||
// this.value = parent.getTileEntityCount();
|
this.value = parent.getTileEntityCount();
|
||||||
// }
|
}
|
||||||
// });
|
});
|
||||||
// }
|
}
|
||||||
//
|
|
||||||
// @Override
|
@Override
|
||||||
// public int getTickableTileEntityCount() {
|
public int getTickableTileEntityCount() {
|
||||||
// return TaskManager.IMP.sync(new RunnableVal<Integer>() {
|
return TaskManager.IMP.sync(new RunnableVal<Integer>() {
|
||||||
// @Override
|
@Override
|
||||||
// public void run(Integer value) {
|
public void run(Integer value) {
|
||||||
// this.value = parent.getTickableTileEntityCount();
|
this.value = parent.getTickableTileEntityCount();
|
||||||
// }
|
}
|
||||||
// });
|
});
|
||||||
// }
|
}
|
||||||
//
|
|
||||||
// @Override
|
@Override
|
||||||
// public int getChunkCount() {
|
public int getChunkCount() {
|
||||||
// return TaskManager.IMP.sync(new RunnableVal<Integer>() {
|
return TaskManager.IMP.sync(new RunnableVal<Integer>() {
|
||||||
// @Override
|
@Override
|
||||||
// public void run(Integer value) {
|
public void run(Integer value) {
|
||||||
// this.value = parent.getChunkCount();
|
this.value = parent.getChunkCount();
|
||||||
// }
|
}
|
||||||
// });
|
});
|
||||||
// }
|
}
|
||||||
//
|
|
||||||
// @Override
|
@Override
|
||||||
// public int getPlayerCount() {
|
public int getPlayerCount() {
|
||||||
// return TaskManager.IMP.sync(new RunnableVal<Integer>() {
|
return TaskManager.IMP.sync(new RunnableVal<Integer>() {
|
||||||
// @Override
|
@Override
|
||||||
// public void run(Integer value) {
|
public void run(Integer value) {
|
||||||
// this.value = parent.getPlayerCount();
|
this.value = parent.getPlayerCount();
|
||||||
// }
|
}
|
||||||
// });
|
});
|
||||||
// }
|
}
|
||||||
//
|
|
||||||
// @Override
|
@Override
|
||||||
// public CompletableFuture<Chunk> getChunkAtAsync(int arg0, int arg1, boolean arg2) {
|
public CompletableFuture<Chunk> getChunkAtAsync(int arg0, int arg1, boolean arg2) {
|
||||||
// return parent.getChunkAtAsync(arg0, arg1, arg2);
|
return parent.getChunkAtAsync(arg0, arg1, arg2);
|
||||||
// }
|
}
|
||||||
//
|
|
||||||
// @Override
|
@Override
|
||||||
// public boolean isDayTime() {
|
public boolean isDayTime() {
|
||||||
// return parent.isDayTime();
|
return parent.isDayTime();
|
||||||
// }
|
}
|
||||||
//
|
|
||||||
// @Override
|
@Override
|
||||||
// public boolean unloadChunk(final int x, final int z, final boolean save, final boolean safe) {
|
public void getChunkAtAsync(int x, int z, ChunkLoadCallback cb) {
|
||||||
// if (isChunkLoaded(x, z)) {
|
parent.getChunkAtAsync(x, z, cb);
|
||||||
// return TaskManager.IMP.sync(new RunnableVal<Boolean>() {
|
}
|
||||||
// @Override
|
|
||||||
// public void run(Boolean value) {
|
@Override
|
||||||
// this.value = parent.unloadChunk(x, z, save, safe);
|
public void getChunkAtAsync(Location location, ChunkLoadCallback cb) {
|
||||||
// }
|
parent.getChunkAtAsync(location, cb);
|
||||||
// });
|
}
|
||||||
// }
|
|
||||||
// return true;
|
@Override
|
||||||
// }
|
public void getChunkAtAsync(Block block, ChunkLoadCallback cb) {
|
||||||
//
|
parent.getChunkAtAsync(block, cb);
|
||||||
// @Override
|
}
|
||||||
// public boolean unloadChunkRequest(int x, int z, boolean safe) {
|
|
||||||
// return unloadChunk(x, z, safe);
|
@Override
|
||||||
// }
|
public Entity getEntity(UUID uuid) {
|
||||||
//
|
return TaskManager.IMP.sync(() -> parent.getEntity(uuid));
|
||||||
// @Override
|
}
|
||||||
// public void getChunkAtAsync(int x, int z, ChunkLoadCallback cb) {
|
|
||||||
// parent.getChunkAtAsync(x, z, cb);
|
|
||||||
// }
|
@Override
|
||||||
//
|
public boolean createExplosion(Entity source, Location loc, float power, boolean setFire, boolean breakBlocks) {
|
||||||
// @Override
|
return TaskManager.IMP.sync(() -> parent.createExplosion(source, loc, power, setFire, breakBlocks));
|
||||||
// public void getChunkAtAsync(Location location, ChunkLoadCallback cb) {
|
}
|
||||||
// parent.getChunkAtAsync(location, cb);
|
|
||||||
// }
|
|
||||||
//
|
@Override
|
||||||
// @Override
|
public <T> void spawnParticle(Particle particle, List<Player> receivers, Player source, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra, T data) {
|
||||||
// public void getChunkAtAsync(Block block, ChunkLoadCallback cb) {
|
parent.spawnParticle(particle, receivers, source, x, y, z, count, offsetX, offsetY, offsetZ, extra, data);
|
||||||
// parent.getChunkAtAsync(block, cb);
|
}
|
||||||
// }
|
|
||||||
//
|
@Override
|
||||||
// @Override
|
public <T> void spawnParticle(Particle particle, List<Player> list, Player player, double v, double v1, double v2, int i, double v3, double v4, double v5, double v6, T t, boolean b) {
|
||||||
// public Entity getEntity(UUID uuid) {
|
parent.spawnParticle(particle, list, player, v, v1, v2, i, v3, v4, v5, v6, t, b);
|
||||||
// return TaskManager.IMP.sync(() -> parent.getEntity(uuid));
|
}
|
||||||
// }
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// @Override
|
|
||||||
// public boolean createExplosion(Entity source, Location loc, float power, boolean setFire, boolean breakBlocks) {
|
|
||||||
// return TaskManager.IMP.sync(() -> parent.createExplosion(source, loc, power, setFire, breakBlocks));
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// @Override
|
|
||||||
// public <T> void spawnParticle(Particle particle, List<Player> receivers, Player source, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra, T data) {
|
|
||||||
// parent.spawnParticle(particle, receivers, source, x, y, z, count, offsetX, offsetY, offsetZ, extra, data);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// @Override
|
|
||||||
// public <T> void spawnParticle(Particle particle, List<Player> list, Player player, double v, double v1, double v2, int i, double v3, double v4, double v5, double v6, T t, boolean b) {
|
|
||||||
// parent.spawnParticle(particle, list, player, v, v1, v2, i, v3, v4, v5, v6, t, b);
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren