Avoid deprecated CompoundTag in API (#2883)

* Avoid deprecated CompoundTag in API

* use javax annotations
This commit is contained in:
Hannes Greule
2024-09-14 10:47:37 +02:00
committed by GitHub
parent 19370a3549
commit 1e8778b528
68 changed files with 1096 additions and 612 deletions

View File

@ -24,12 +24,12 @@ import com.fastasyncworldedit.core.Fawe;
import com.fastasyncworldedit.core.FaweCache;
import com.fastasyncworldedit.core.configuration.Settings;
import com.fastasyncworldedit.core.internal.exception.FaweException;
import com.fastasyncworldedit.core.nbt.FaweCompoundTag;
import com.fastasyncworldedit.core.queue.IChunkGet;
import com.fastasyncworldedit.core.queue.implementation.packet.ChunkPacket;
import com.fastasyncworldedit.core.util.TaskManager;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Sets;
import com.sk89q.jnbt.CompoundTag;
import com.sk89q.worldedit.EditSession;
import com.sk89q.worldedit.WorldEditException;
import com.sk89q.worldedit.blocks.BaseItem;
@ -665,7 +665,7 @@ public class BukkitWorld extends AbstractWorld {
}
@Override
public boolean setTile(int x, int y, int z, CompoundTag tile) throws WorldEditException {
public boolean tile(int x, int y, int z, FaweCompoundTag tile) throws WorldEditException {
return false;
}

View File

@ -165,9 +165,11 @@ public class BukkitImplLoader {
* @throws AdapterLoadException thrown if no adapter could be found
*/
public BukkitImplAdapter loadAdapter() throws AdapterLoadException {
// FAWE - do not initialize classes on lookup
final ClassLoader classLoader = this.getClass().getClassLoader();
for (String className : adapterCandidates) {
try {
Class<?> cls = Class.forName(className);
Class<?> cls = Class.forName(className, false, classLoader);
if (cls.isSynthetic()) {
continue;
}