Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ body:
description: Which server version version you using? If your server version is not listed, it is not supported. Update to a supported version first.
multiple: false
options:
- '26.1'
- '1.21.11'
- '1.21.10'
- '1.21.8'
Expand Down
15 changes: 10 additions & 5 deletions build-logic/src/main/kotlin/buildlogic.adapter.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,23 @@ repositories {
name = "PaperMC"
url = uri("https://repo.papermc.io/repository/maven-public/")
content {
excludeModule("io.papermc.paper", "dev-bundle")
// excludeModule("io.papermc.paper", "dev-bundle")
}
}
maven {
name = "EngineHub Repository"
url = uri("https://maven.enginehub.org/repo/")
content {
excludeModule("io.papermc.paper", "dev-bundle")
// excludeModule("io.papermc.paper", "dev-bundle")
}
}
maven {
/* maven {
name = "IntellectualSites"
url = uri("https://repo.intellectualsites.dev/repository/paper-dev-bundles/")
content {
includeModule("io.papermc.paper", "dev-bundle")
// includeModule("io.papermc.paper", "dev-bundle")
}
}
}*/
mavenCentral()
afterEvaluate {
killNonEngineHubRepositories()
Expand All @@ -52,6 +52,11 @@ dependencies {
}
}

java {
// Required when we de-sync release option and declared Java versions.
disableAutoTargetJvm()
}

tasks.named("assemble") {
dependsOn("reobfJar")
}
Expand Down
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ allprojects {
}

val supportedVersions: List<String> = listOf("1.20.4", "1.20.5", "1.20.6", "1.21", "1.21.1", "1.21.4", "1.21.5",
"1.21.8", "1.21.10", "1.21.11")
"1.21.8", "1.21.10", "1.21.11", "26.1")

tasks {
supportedVersions.forEach {
Expand Down
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ pluginyml = "0.6.0"
mod-publish-plugin = "1.1.0"
grgit = "5.3.3"
shadow = "9.4.1"
paperweight = "2.0.0-beta.19"
paperweight = "2.0.0-beta.21"
codecov = "0.2.0"


Expand Down
4 changes: 2 additions & 2 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ includeBuild("build-logic")

include("worldedit-libs")

listOf("1_20_2", "1_20_4", "1_20_5", "1_21", "1_21_4", "1_21_5", "1_21_6", "1_21_9", "1_21_11").forEach {
listOf("1_20_2", "1_20_4", "1_20_5", "1_21", "1_21_4", "1_21_5", "1_21_6", "1_21_9", "1_21_11", "26.1").forEach {
include("worldedit-bukkit:adapters:adapter-$it")
}

Expand All @@ -66,4 +66,4 @@ listOf("bukkit", "core", "cli").forEach {
include("worldedit-libs:core:ap")


enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS")
// enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS")
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ plugins {

dependencies {
// https://repo.papermc.io/service/rest/repository/browse/maven-public/io/papermc/paper/dev-bundle/
the<PaperweightUserDependenciesExtension>().paperDevBundle("1.21.11-R0.1-20251223.192256-16")
the<PaperweightUserDependenciesExtension>().paperDevBundle("1.21.11-R0.1-20260310.030221-86")
compileOnly(libs.paperLib)
}
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,9 @@ public PaperweightAdapter() throws NoSuchFieldException, NoSuchMethodException {
if (dataVersion != Constants.DATA_VERSION_MC_1_21_6 && dataVersion != Constants.DATA_VERSION_MC_1_21_7 && dataVersion != Constants.DATA_VERSION_MC_1_21_8) {
throw new UnsupportedClassVersionError("Not 1.21.(6/7/8)!");
}
if (dataVersion >= Constants.DATA_VERSION_MC_26_1) {
throw new RuntimeException("Force prevent this loading on 26.1+");
}

serverWorldsField = CraftServer.class.getDeclaredField("worlds");
serverWorldsField.setAccessible(true);
Expand Down
11 changes: 11 additions & 0 deletions worldedit-bukkit/adapters/adapter-26.1/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import io.papermc.paperweight.userdev.PaperweightUserDependenciesExtension

plugins {
id("buildlogic.adapter")
}

dependencies {
// https://artifactory.papermc.io/ui/native/universe/io/papermc/paper/dev-bundle/
the<PaperweightUserDependenciesExtension>().paperDevBundle("26.1.1.build.20-alpha")
compileOnly(libs.paperLib)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,231 @@
package com.sk89q.worldedit.bukkit.adapter.impl.fawe.v26_1;

import com.fastasyncworldedit.core.util.MathMan;
import com.sk89q.worldedit.bukkit.adapter.impl.fawe.v26_1.PaperweightChunkAccessProxy;
import it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.core.Holder;
import net.minecraft.core.SectionPos;
import net.minecraft.core.particles.ParticleOptions;
import net.minecraft.server.MinecraftServer;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.sounds.SoundEvent;
import net.minecraft.sounds.SoundSource;
import net.minecraft.util.RandomSource;
import net.minecraft.world.DifficultyInstance;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.flag.FeatureFlagSet;
import net.minecraft.world.level.biome.Biome;
import net.minecraft.world.level.biome.BiomeManager;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.border.WorldBorder;
import net.minecraft.world.level.chunk.ChunkAccess;
import net.minecraft.world.level.chunk.ChunkSource;
import net.minecraft.world.level.chunk.status.ChunkStatus;
import net.minecraft.world.level.lighting.LevelLightEngine;
import net.minecraft.world.level.material.FluidState;
import org.bukkit.craftbukkit.util.BlockStateListPopulator;
import org.jetbrains.annotations.NotNull;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import java.util.List;

public class FaweBlockStateListPopulator extends BlockStateListPopulator {

private final Long2ObjectOpenHashMap<PaperweightChunkAccessProxy> chunkProxies = new Long2ObjectOpenHashMap<>();
private final ServerLevel world;

public FaweBlockStateListPopulator(ServerLevel world) {
super(world);
this.world = world;
}

@Override
public long getSeed() {
return world.getSeed();
}

@Override
@Nonnull
public ServerLevel getLevel() {
return world.getLevel();
}

@Override
@Nonnull
public DifficultyInstance getCurrentDifficultyAt(final BlockPos pos) {
return world.getCurrentDifficultyAt(pos);
}

@Override
public MinecraftServer getServer() {
return world.getServer();
}

@Override
@Nonnull
public ChunkSource getChunkSource() {
return world.getChunkSource();
}

@Override
@Nonnull
public RandomSource getRandom() {
return world.getRandom();
}

@Override
public void playSound(
final Entity source,
final BlockPos pos,
final SoundEvent sound,
final SoundSource category,
final float volume,
final float pitch
) {
// don't for now
}

@Override
public void addParticle(
final ParticleOptions parameters,
final double x,
final double y,
final double z,
final double velocityX,
final double velocityY,
final double velocityZ
) {
// definitely don't
}

@Override
public @NotNull List<? extends Player> players() {
return world.players();
}

@Override
public ChunkAccess getChunk(final int chunkX, final int chunkZ, final ChunkStatus leastStatus, final boolean create) {
ChunkAccess worldChunk = world.getChunk(chunkX, chunkZ, leastStatus, create);
PaperweightChunkAccessProxy proxy = chunkProxies.compute(
MathMan.pairInt(chunkX, chunkZ),
(k, v) -> v == null ? PaperweightChunkAccessProxy.getInstance() : v
);
proxy.parent = worldChunk;
return proxy;
}

@Override
@Nonnull
public BiomeManager getBiomeManager() {
return world.getBiomeManager();
}

@Override
@Nonnull
public Holder<Biome> getUncachedNoiseBiome(final int biomeX, final int biomeY, final int biomeZ) {
return world.getUncachedNoiseBiome(biomeX, biomeY, biomeZ);
}

@Override
public int getSeaLevel() {
return world.getSeaLevel();
}

@Override
public @Nonnull ChunkAccess getChunk(final @Nonnull BlockPos pos) {
ChunkAccess worldChunk = world.getChunk(pos);
PaperweightChunkAccessProxy proxy = chunkProxies.compute(
MathMan.pairInt(SectionPos.blockToSectionCoord(pos.getX()), SectionPos.blockToSectionCoord(pos.getZ())),
(k, v) -> v == null ? PaperweightChunkAccessProxy.getInstance() : v
);
proxy.parent = worldChunk;
return proxy;
}

@Override
public @Nonnull ChunkAccess getChunk(final int chunkX, final int chunkZ) {
ChunkAccess worldChunk = world.getChunk(chunkX, chunkZ);
PaperweightChunkAccessProxy proxy = chunkProxies.compute(
MathMan.pairInt(chunkX, chunkZ),
(k, v) -> v == null ? PaperweightChunkAccessProxy.getInstance() : v
);
proxy.parent = worldChunk;
return proxy;
}

@Override
public @Nonnull ChunkAccess getChunk(final int chunkX, final int chunkZ, final @Nonnull ChunkStatus chunkStatus) {
ChunkAccess worldChunk = world.getChunk(chunkX, chunkZ, chunkStatus);
PaperweightChunkAccessProxy proxy = chunkProxies.compute(
MathMan.pairInt(chunkX, chunkZ),
(k, v) -> v == null ? PaperweightChunkAccessProxy.getInstance() : v
);
proxy.parent = worldChunk;
return proxy;
}

@Override
@Nonnull
public FeatureFlagSet enabledFeatures() {
return world.enabledFeatures();
}

@Override
@Nonnull
public LevelLightEngine getLightEngine() {
return world.getLightEngine();
}

@Nullable
@Override
public ChunkAccess getChunkIfLoadedImmediately(final int x, final int z) {
return world.getChunkIfLoadedImmediately(x, z);
}

@Override
public BlockState getBlockStateIfLoaded(final BlockPos blockposition) {
return world.getBlockStateIfLoaded(blockposition);
}

@Override
public FluidState getFluidIfLoaded(final BlockPos blockposition) {
return world.getFluidIfLoaded(blockposition);
}

@Override
@Nonnull
public WorldBorder getWorldBorder() {
return world.getWorldBorder();
}

@Override
public boolean setBlock(final BlockPos pos, final BlockState state, final int flags, final int maxUpdateDepth) {
return world.setBlock(pos, state, flags, maxUpdateDepth);
}

@Override
public boolean removeBlock(final BlockPos pos, final boolean move) {
return world.removeBlock(pos, move);
}

@Override
public boolean destroyBlock(final BlockPos pos, final boolean drop, final Entity breakingEntity, final int maxUpdateDepth) {
return world.destroyBlock(pos, drop, breakingEntity, maxUpdateDepth);
}

@Override
@Nonnull
public BlockState getBlockState(final BlockPos pos) {
return world.getBlockState(pos);
}

@Override
public boolean setBlock(final BlockPos pos, final BlockState state, final int flags) {
return world.setBlock(pos, state, flags);
}

}
Loading
Loading