3
0
Mirror von https://github.com/IntellectualSites/FastAsyncWorldEdit.git synchronisiert 2024-11-20 01:40:06 +01:00

Merge branch 'main' into feat/feature-placement

# Conflicts:
#	worldedit-bukkit/adapters/adapter-1_21/src/main/java/com/sk89q/worldedit/bukkit/adapter/impl/fawe/v1_21_R1/PaperweightFaweAdapter.java
Dieser Commit ist enthalten in:
dordsor21 2024-07-02 19:36:38 +01:00
Commit 8047ccb8f5
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 1E53E88969FFCF0B
7 geänderte Dateien mit 94 neuen und 103 gelöschten Zeilen

Datei anzeigen

@ -349,7 +349,6 @@ public final class PaperweightPlatformAdapter extends NMSAdapter {
MinecraftServer.getServer().execute(() -> { MinecraftServer.getServer().execute(() -> {
ClientboundLevelChunkWithLightPacket packet; ClientboundLevelChunkWithLightPacket packet;
if (PaperLib.isPaper()) { if (PaperLib.isPaper()) {
synchronized (chunk) {
packet = new ClientboundLevelChunkWithLightPacket( packet = new ClientboundLevelChunkWithLightPacket(
levelChunk, levelChunk,
nmsWorld.getChunkSource().getLightEngine(), nmsWorld.getChunkSource().getLightEngine(),
@ -358,9 +357,7 @@ public final class PaperweightPlatformAdapter extends NMSAdapter {
true, true,
false // last false is to not bother with x-ray false // last false is to not bother with x-ray
); );
}
} else { } else {
synchronized (chunk) {
// deprecated on paper - deprecation suppressed // deprecated on paper - deprecation suppressed
packet = new ClientboundLevelChunkWithLightPacket( packet = new ClientboundLevelChunkWithLightPacket(
levelChunk, levelChunk,
@ -370,7 +367,6 @@ public final class PaperweightPlatformAdapter extends NMSAdapter {
true true
); );
} }
}
nearbyPlayers(nmsWorld, coordIntPair).forEach(p -> p.connection.send(packet)); nearbyPlayers(nmsWorld, coordIntPair).forEach(p -> p.connection.send(packet));
}); });
} }

Datei anzeigen

@ -364,7 +364,6 @@ public final class PaperweightPlatformAdapter extends NMSAdapter {
MinecraftServer.getServer().execute(() -> { MinecraftServer.getServer().execute(() -> {
ClientboundLevelChunkWithLightPacket packet; ClientboundLevelChunkWithLightPacket packet;
if (PaperLib.isPaper()) { if (PaperLib.isPaper()) {
synchronized (chunk) {
packet = new ClientboundLevelChunkWithLightPacket( packet = new ClientboundLevelChunkWithLightPacket(
levelChunk, levelChunk,
nmsWorld.getChunkSource().getLightEngine(), nmsWorld.getChunkSource().getLightEngine(),
@ -372,9 +371,7 @@ public final class PaperweightPlatformAdapter extends NMSAdapter {
null, null,
false // last false is to not bother with x-ray false // last false is to not bother with x-ray
); );
}
} else { } else {
synchronized (chunk) {
// deprecated on paper - deprecation suppressed // deprecated on paper - deprecation suppressed
packet = new ClientboundLevelChunkWithLightPacket( packet = new ClientboundLevelChunkWithLightPacket(
levelChunk, levelChunk,
@ -383,7 +380,6 @@ public final class PaperweightPlatformAdapter extends NMSAdapter {
null null
); );
} }
}
nearbyPlayers(nmsWorld, coordIntPair).forEach(p -> p.connection.send(packet)); nearbyPlayers(nmsWorld, coordIntPair).forEach(p -> p.connection.send(packet));
}); });
} }

Datei anzeigen

@ -364,7 +364,6 @@ public final class PaperweightPlatformAdapter extends NMSAdapter {
MinecraftServer.getServer().execute(() -> { MinecraftServer.getServer().execute(() -> {
ClientboundLevelChunkWithLightPacket packet; ClientboundLevelChunkWithLightPacket packet;
if (PaperLib.isPaper()) { if (PaperLib.isPaper()) {
synchronized (chunk) {
packet = new ClientboundLevelChunkWithLightPacket( packet = new ClientboundLevelChunkWithLightPacket(
levelChunk, levelChunk,
nmsWorld.getChunkSource().getLightEngine(), nmsWorld.getChunkSource().getLightEngine(),
@ -372,9 +371,7 @@ public final class PaperweightPlatformAdapter extends NMSAdapter {
null, null,
false // last false is to not bother with x-ray false // last false is to not bother with x-ray
); );
}
} else { } else {
synchronized (chunk) {
// deprecated on paper - deprecation suppressed // deprecated on paper - deprecation suppressed
packet = new ClientboundLevelChunkWithLightPacket( packet = new ClientboundLevelChunkWithLightPacket(
levelChunk, levelChunk,
@ -383,7 +380,6 @@ public final class PaperweightPlatformAdapter extends NMSAdapter {
null null
); );
} }
}
nearbyPlayers(nmsWorld, coordIntPair).forEach(p -> p.connection.send(packet)); nearbyPlayers(nmsWorld, coordIntPair).forEach(p -> p.connection.send(packet));
}); });
} }

Datei anzeigen

@ -353,7 +353,6 @@ public final class PaperweightPlatformAdapter extends NMSAdapter {
MinecraftServer.getServer().execute(() -> { MinecraftServer.getServer().execute(() -> {
ClientboundLevelChunkWithLightPacket packet; ClientboundLevelChunkWithLightPacket packet;
if (PaperLib.isPaper()) { if (PaperLib.isPaper()) {
synchronized (chunk) {
packet = new ClientboundLevelChunkWithLightPacket( packet = new ClientboundLevelChunkWithLightPacket(
levelChunk, levelChunk,
nmsWorld.getChunkSource().getLightEngine(), nmsWorld.getChunkSource().getLightEngine(),
@ -361,9 +360,7 @@ public final class PaperweightPlatformAdapter extends NMSAdapter {
null, null,
false // last false is to not bother with x-ray false // last false is to not bother with x-ray
); );
}
} else { } else {
synchronized (chunk) {
// deprecated on paper - deprecation suppressed // deprecated on paper - deprecation suppressed
packet = new ClientboundLevelChunkWithLightPacket( packet = new ClientboundLevelChunkWithLightPacket(
levelChunk, levelChunk,
@ -372,7 +369,6 @@ public final class PaperweightPlatformAdapter extends NMSAdapter {
null null
); );
} }
}
nearbyPlayers(nmsWorld, coordIntPair).forEach(p -> p.connection.send(packet)); nearbyPlayers(nmsWorld, coordIntPair).forEach(p -> p.connection.send(packet));
}); });
} }

Datei anzeigen

@ -21,7 +21,6 @@ import com.sk89q.worldedit.bukkit.BukkitAdapter;
import com.sk89q.worldedit.bukkit.adapter.BukkitImplAdapter; import com.sk89q.worldedit.bukkit.adapter.BukkitImplAdapter;
import com.sk89q.worldedit.bukkit.adapter.ext.fawe.v1_21_R1.PaperweightAdapter; import com.sk89q.worldedit.bukkit.adapter.ext.fawe.v1_21_R1.PaperweightAdapter;
import com.sk89q.worldedit.bukkit.adapter.impl.fawe.v1_21_R1.nbt.PaperweightLazyCompoundTag; import com.sk89q.worldedit.bukkit.adapter.impl.fawe.v1_21_R1.nbt.PaperweightLazyCompoundTag;
import com.sk89q.worldedit.bukkit.adapter.impl.fawe.v1_21_R1.regen.PaperweightRegen;
import com.sk89q.worldedit.entity.BaseEntity; import com.sk89q.worldedit.entity.BaseEntity;
import com.sk89q.worldedit.extent.Extent; import com.sk89q.worldedit.extent.Extent;
import com.sk89q.worldedit.internal.block.BlockStateIdAccess; import com.sk89q.worldedit.internal.block.BlockStateIdAccess;
@ -733,10 +732,10 @@ public final class PaperweightFaweAdapter extends FaweAdapter<net.minecraft.nbt.
return parent.fromNative(foreign); return parent.fromNative(foreign);
} }
@Override // @Override
public boolean regenerate(World bukkitWorld, Region region, Extent target, RegenOptions options) throws Exception { // public boolean regenerate(org.bukkit.World bukkitWorld, Region region, Extent target, RegenOptions options) throws Exception {
return new PaperweightRegen(bukkitWorld, region, target, options).regenerate(); // return new PaperweightRegen(bukkitWorld, region, target, options).regenerate();
} // }
@Override @Override
public IChunkGet get(World world, int chunkX, int chunkZ) { public IChunkGet get(World world, int chunkX, int chunkZ) {

Datei anzeigen

@ -141,7 +141,14 @@ public final class PaperweightPlatformAdapter extends NMSAdapter {
fieldTickingFluidCount.setAccessible(true); fieldTickingFluidCount.setAccessible(true);
fieldTickingBlockCount = LevelChunkSection.class.getDeclaredField(Refraction.pickName("tickingBlockCount", "f")); fieldTickingBlockCount = LevelChunkSection.class.getDeclaredField(Refraction.pickName("tickingBlockCount", "f"));
fieldTickingBlockCount.setAccessible(true); fieldTickingBlockCount.setAccessible(true);
fieldBiomes = LevelChunkSection.class.getDeclaredField(Refraction.pickName("biomes", "i")); Field tmpFieldBiomes;
try {
// Seems it's sometimes biomes and sometimes "i". Idk this is just easier than having to try to deal with it
tmpFieldBiomes = LevelChunkSection.class.getDeclaredField("biomes"); // apparently unobf
} catch (NoSuchFieldException ignored) {
tmpFieldBiomes = LevelChunkSection.class.getDeclaredField("i"); // apparently obf
}
fieldBiomes = tmpFieldBiomes;
fieldBiomes.setAccessible(true); fieldBiomes.setAccessible(true);
Method getVisibleChunkIfPresent = ChunkMap.class.getDeclaredMethod(Refraction.pickName( Method getVisibleChunkIfPresent = ChunkMap.class.getDeclaredMethod(Refraction.pickName(
@ -354,7 +361,6 @@ public final class PaperweightPlatformAdapter extends NMSAdapter {
MinecraftServer.getServer().execute(() -> { MinecraftServer.getServer().execute(() -> {
ClientboundLevelChunkWithLightPacket packet; ClientboundLevelChunkWithLightPacket packet;
if (PaperLib.isPaper()) { if (PaperLib.isPaper()) {
synchronized (chunk) {
packet = new ClientboundLevelChunkWithLightPacket( packet = new ClientboundLevelChunkWithLightPacket(
levelChunk, levelChunk,
nmsWorld.getChunkSource().getLightEngine(), nmsWorld.getChunkSource().getLightEngine(),
@ -362,9 +368,7 @@ public final class PaperweightPlatformAdapter extends NMSAdapter {
null, null,
false // last false is to not bother with x-ray false // last false is to not bother with x-ray
); );
}
} else { } else {
synchronized (chunk) {
// deprecated on paper - deprecation suppressed // deprecated on paper - deprecation suppressed
packet = new ClientboundLevelChunkWithLightPacket( packet = new ClientboundLevelChunkWithLightPacket(
levelChunk, levelChunk,
@ -373,7 +377,6 @@ public final class PaperweightPlatformAdapter extends NMSAdapter {
null null
); );
} }
}
nearbyPlayers(nmsWorld, coordIntPair).forEach(p -> p.connection.send(packet)); nearbyPlayers(nmsWorld, coordIntPair).forEach(p -> p.connection.send(packet));
}); });
} }

Datei anzeigen

@ -2,13 +2,10 @@ package com.fastasyncworldedit.core.extent.clipboard;
import com.fastasyncworldedit.core.Fawe; import com.fastasyncworldedit.core.Fawe;
import com.sk89q.jnbt.CompoundTag; import com.sk89q.jnbt.CompoundTag;
import com.sk89q.jnbt.NBTUtils;
import com.sk89q.jnbt.Tag;
import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.EditSession;
import com.sk89q.worldedit.entity.BaseEntity; import com.sk89q.worldedit.entity.BaseEntity;
import com.sk89q.worldedit.entity.Entity; import com.sk89q.worldedit.entity.Entity;
import com.sk89q.worldedit.extent.Extent; import com.sk89q.worldedit.extent.Extent;
import com.sk89q.worldedit.extent.clipboard.BlockArrayClipboard;
import com.sk89q.worldedit.math.BlockVector3; import com.sk89q.worldedit.math.BlockVector3;
import com.sk89q.worldedit.regions.Region; import com.sk89q.worldedit.regions.Region;
import com.sk89q.worldedit.session.request.Request; import com.sk89q.worldedit.session.request.Request;
@ -18,9 +15,7 @@ import com.sk89q.worldedit.world.biome.BiomeType;
import com.sk89q.worldedit.world.block.BlockStateHolder; import com.sk89q.worldedit.world.block.BlockStateHolder;
import javax.annotation.Nullable; import javax.annotation.Nullable;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map;
import java.util.UUID; import java.util.UUID;
import java.util.function.Supplier; import java.util.function.Supplier;
@ -77,6 +72,16 @@ public abstract class ReadOnlyClipboard extends SimpleClipboard {
}; };
} }
@Override
public BlockVector3 getMinimumPoint() {
return region.getMinimumPoint();
}
@Override
public BlockVector3 getMaximumPoint() {
return region.getMaximumPoint();
}
@Override @Override
public Region getRegion() { public Region getRegion() {
return region; return region;