3
0
Mirror von https://github.com/IntellectualSites/FastAsyncWorldEdit.git synchronisiert 2024-10-03 20:21:05 +02:00

Build back to paper adapter

Dieser Commit ist enthalten in:
Phillip Glanz 2023-04-02 20:43:09 +02:00 committet von Phillipp Glanz
Ursprung cebaaea153
Commit c840a9cc6a

Datei anzeigen

@ -11,10 +11,10 @@ import com.sk89q.worldedit.util.SideEffect;
import com.sk89q.worldedit.util.SideEffectSet;
import com.sk89q.worldedit.util.nbt.CompoundBinaryTag;
import com.sk89q.worldedit.world.block.BlockState;
import io.papermc.paper.threadedregions.RegionizedServer;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.server.MinecraftServer;
import net.minecraft.server.level.ChunkHolder;
import net.minecraft.server.level.ServerChunkCache;
import net.minecraft.world.level.Level;
@ -58,7 +58,7 @@ public class PaperweightFaweWorldNativeAccess implements WorldNativeAccess<Level
this.level = level;
// Use the actual tick as minecraft-defined so we don't try to force blocks into the world when the server's already lagging.
// - With the caveat that we don't want to have too many cached changed (1024) so we'd flush those at 1024 anyway.
this.lastTick = new AtomicInteger((int) RegionizedServer.getGlobalTickData().getCurrentTick());
this.lastTick = new AtomicInteger(MinecraftServer.currentTick);
}
private Level getLevel() {
@ -94,7 +94,7 @@ public class PaperweightFaweWorldNativeAccess implements WorldNativeAccess<Level
LevelChunk levelChunk, BlockPos blockPos,
net.minecraft.world.level.block.state.BlockState blockState
) {
int currentTick = (int) RegionizedServer.getGlobalTickData().getCurrentTick();
int currentTick = MinecraftServer.currentTick;
if (Fawe.isMainThread()) {
return levelChunk.setBlockState(blockPos, blockState,
this.sideEffectSet != null && this.sideEffectSet.shouldApply(SideEffect.UPDATE)