Merge branch 'version/7.3.x'

This commit is contained in:
Madeline Miller 2024-08-09 22:58:08 +10:00
commit 6f210ad398
No known key found for this signature in database
GPG Key ID: B8EA2E5693115D81
28 changed files with 220 additions and 149 deletions

View File

@ -1,3 +1,9 @@
7.3.5
- [Bukkit] Utilise new Bukkit registry API, allowing WorldEdit to work with Commodore disabled (`paper.disableOldApiSupport` flag on Paper)
- Fix queryRel not behaving correctly in //deform and the deform brush
- Shutdown the executor service on disable, to prevent waiting on async tasks before shutting down
- Remove legacy code for pre-1.16 //drawsel handling
7.3.4
- Added support for 1.21
- Fixed an issue where //drawsel can prevent using //world overrides in some situation

View File

@ -8,10 +8,6 @@
name = "EngineHub Repository"
url = uri("https://maven.enginehub.org/repo/")
}
maven {
name = "SpongePowered"
url = uri("https://repo.spongepowered.org/repository/maven-public/")
}
}
dependencies {

View File

@ -12,6 +12,21 @@
banSlf4j = false
}
paperweight {
injectPaperRepository = false
}
repositories {
maven {
name = "EngineHub"
url = uri("https://maven.enginehub.org/repo/")
}
mavenCentral()
afterEvaluate {
killNonEngineHubRepositories()
}
}
dependencies {
"implementation"(project(":worldedit-bukkit"))
constraints {

View File

@ -9,14 +9,6 @@
group = rootProject.group
version = rootProject.version
repositories {
mavenCentral()
maven {
name = "EngineHub"
url = uri("https://maven.enginehub.org/repo/")
}
}
configurations.all {
resolutionStrategy {
cacheChangingModulesFor(1, TimeUnit.DAYS)

View File

@ -0,0 +1,37 @@
import org.gradle.api.artifacts.dsl.RepositoryHandler
import org.gradle.api.artifacts.repositories.MavenArtifactRepository
import org.gradle.api.logging.Logging
// The primary point of this is repository up-time. We replace most other repositories with EngineHub's repository.
// This is because we have stronger up-time guarantees for our repository. However, Maven Central and Sonatype are
// clearly even better, so we allow those as well. We also allow Gradle's plugin repository.
private val ALLOWED_PREFIXES = listOf(
"https://maven.enginehub.org",
"https://repo.maven.apache.org/maven2/",
"https://s01.oss.sonatype.org/content/repositories/snapshots/",
"https://plugins.gradle.org",
"file:"
)
private val LOGGER = Logging.getLogger("repositoriesHelper")
fun RepositoryHandler.killNonEngineHubRepositories() {
val toRemove = mutableListOf<MavenArtifactRepository>()
for (repo in this) {
if (repo is MavenArtifactRepository && !ALLOWED_PREFIXES.any { repo.url.toString().startsWith(it) }) {
LOGGER.info("Removing non-EngineHub repository: {}", repo.url)
toRemove.add(repo)
}
}
toRemove.forEach { remove(it) }
}
fun RepositoryHandler.verifyEngineHubRepositories() {
for (repo in this) {
if (repo is MavenArtifactRepository) {
val urlString = repo.url.toString()
check(ALLOWED_PREFIXES.any { urlString.startsWith(it) }) {
"Only EngineHub/Central repositories are allowed: ${repo.url} found"
}
}
}
}

View File

@ -3,3 +3,6 @@ version=7.4.0-SNAPSHOT
org.gradle.jvmargs=-Xmx1500M
org.gradle.parallel=true
loom_fabric_repository=https://maven.enginehub.org/artifactory/fabricmc/
loom_libraries_base=https://maven.enginehub.org/artifactory/minecraft/

View File

@ -47,7 +47,7 @@ jfrog-buildinfo = "org.jfrog.buildinfo:build-info-extractor-gradle:5.2.0"
fabric-mixin = "net.fabricmc:sponge-mixin:0.13.3+mixin.0.8.5"
paperweight = "io.papermc.paperweight.userdev:io.papermc.paperweight.userdev.gradle.plugin:1.7.1"
paperweight = "io.papermc.paperweight.userdev:io.papermc.paperweight.userdev.gradle.plugin:1.7.2"
linBus-bom = "org.enginehub.lin-bus:lin-bus-bom:0.1.0"
linBus-common.module = "org.enginehub.lin-bus:lin-bus-common"

Binary file not shown.

View File

@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME

5
gradlew vendored
View File

@ -15,6 +15,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
#
##############################################################################
#
@ -84,7 +86,8 @@ done
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
' "$PWD" ) || exit
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum

2
gradlew.bat vendored
View File

@ -13,6 +13,8 @@
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@rem SPDX-License-Identifier: Apache-2.0
@rem
@if "%DEBUG%"=="" @echo off
@rem ##########################################################################

View File

@ -5,14 +5,50 @@
name = "EngineHub"
url = uri("https://maven.enginehub.org/repo/")
}
maven {
name = "SpongePowered"
url = uri("https://repo.spongepowered.org/repository/maven-public/")
}
}
}
plugins {
id("org.gradle.toolchains.foojay-resolver-convention") version "0.8.0"
id("fabric-loom") version "1.6.12"
}
dependencyResolutionManagement {
repositories {
maven {
name = "EngineHub"
url = uri("https://maven.enginehub.org/repo/")
}
ivy {
url = uri("https://repo.enginehub.org/language-files/")
name = "EngineHub Language Files"
patternLayout {
artifact("[organisation]/[module]/[revision]/[artifact]-[revision](+[classifier])(.[ext])")
setM2compatible(true)
}
metadataSources {
artifact()
}
content {
includeModuleByRegex(".*", "worldedit-lang")
}
}
gradle.settingsEvaluated {
// Duplicates repositoriesHelper.kt, since we can't import it
val allowedPrefixes = listOf(
"https://maven.enginehub.org",
"https://repo.maven.apache.org/maven2/",
"file:"
)
for (repo in this@repositories) {
if (repo is MavenArtifactRepository) {
val urlString = repo.url.toString()
check(allowedPrefixes.any { urlString.startsWith(it) }) {
"Only EngineHub/Central repositories are allowed: ${repo.url} found"
}
}
}
}
}
}
logger.lifecycle("""

View File

@ -11,21 +11,6 @@
id("me.champeau.gradle.japicmp")
}
repositories {
maven {
name = "EngineHub Repository (Releases Only)"
url = uri("https://maven.enginehub.org/artifactory/libs-release-local/")
}
maven {
name = "EngineHub Repository (Snapshots Only)"
url = uri("https://maven.enginehub.org/artifactory/libs-snapshot-local/")
content {
excludeGroup("com.sk89q.worldedit")
}
}
mavenCentral()
}
val resetAcceptedApiChangesFiles by tasks.registering {
group = "API Compatibility"
description = "Resets ALL the accepted API changes files"

View File

@ -6,5 +6,5 @@
dependencies {
// https://repo.papermc.io/service/rest/repository/browse/maven-public/io/papermc/paper/dev-bundle/
the<PaperweightUserDependenciesExtension>().paperDevBundle("1.21-R0.1-20240618.005323-5")
the<PaperweightUserDependenciesExtension>().paperDevBundle("1.21-R0.1-20240807.125219-129")
}

View File

@ -217,8 +217,8 @@ public PaperweightAdapter() throws NoSuchFieldException, NoSuchMethodException {
CraftServer.class.cast(Bukkit.getServer());
int dataVersion = CraftMagicNumbers.INSTANCE.getDataVersion();
if (dataVersion != 3953) {
throw new UnsupportedClassVersionError("Not 1.21!");
if (dataVersion != 3953 && dataVersion != 3955) {
throw new UnsupportedClassVersionError("Not 1.21(.1)!");
}
serverWorldsField = CraftServer.class.getDeclaredField("worlds");

View File

@ -11,13 +11,6 @@
includeClasspath = true
}
repositories {
maven {
name = "Spigot"
url = uri("https://hub.spigotmc.org/nexus/content/groups/public")
}
}
val localImplementation = configurations.create("localImplementation") {
description = "Dependencies used locally, but provided by the runtime Bukkit implementation"
isCanBeConsumed = false

View File

@ -82,6 +82,7 @@ private BukkitAdapter() {
static {
TO_BLOCK_CONTEXT.setRestricted(false);
TO_BLOCK_CONTEXT.setTryLegacy(false);
}
/**
@ -334,7 +335,8 @@ public static Entity adapt(org.bukkit.entity.Entity entity) {
*/
public static Material adapt(ItemType itemType) {
checkNotNull(itemType);
return Material.matchMaterial(itemType.id());
NamespacedKey key = checkNotNull(NamespacedKey.fromString(itemType.id()), "Item type key is invalid");
return Registry.MATERIAL.get(key);
}
/**
@ -345,7 +347,8 @@ public static Material adapt(ItemType itemType) {
*/
public static Material adapt(BlockType blockType) {
checkNotNull(blockType);
return Material.matchMaterial(blockType.id());
NamespacedKey key = checkNotNull(NamespacedKey.fromString(blockType.id()), "Block type key is invalid");
return Registry.MATERIAL.get(key);
}
/**

View File

@ -216,8 +216,9 @@ private void initializeRegistries() {
});
// Block & Item
Registry.MATERIAL.forEach(material -> {
String key = material.getKey().toString();
if (material.isBlock()) {
BlockType.REGISTRY.register(material.getKey().toString(), new BlockType(material.getKey().toString(), blockState -> {
BlockType.REGISTRY.register(key, new BlockType(key, blockState -> {
// TODO Use something way less hacky than this.
ParserContext context = new ParserContext();
context.setPreferringWildcard(true);
@ -234,13 +235,13 @@ private void initializeRegistries() {
}
return defaultState;
} catch (InputParseException e) {
getLogger().log(Level.WARNING, "Error loading block state for " + material.getKey(), e);
getLogger().log(Level.WARNING, "Error loading block state for " + key, e);
return blockState;
}
}));
}
if (material.isItem()) {
ItemType.REGISTRY.register(material.getKey().toString(), new ItemType(material.getKey().toString()));
ItemType.REGISTRY.register(key, new ItemType(key));
}
});
// Entity
@ -262,10 +263,12 @@ private void initializeRegistries() {
private void setupTags() {
// Tags
for (Tag<Material> blockTag : Bukkit.getTags(Tag.REGISTRY_BLOCKS, Material.class)) {
BlockCategory.REGISTRY.register(blockTag.getKey().toString(), new BlockCategory(blockTag.getKey().toString()));
String key = blockTag.getKey().toString();
BlockCategory.REGISTRY.register(key, new BlockCategory(key));
}
for (Tag<Material> itemTag : Bukkit.getTags(Tag.REGISTRY_ITEMS, Material.class)) {
ItemCategory.REGISTRY.register(itemTag.getKey().toString(), new ItemCategory(itemTag.getKey().toString()));
String key = itemTag.getKey().toString();
ItemCategory.REGISTRY.register(key, new ItemCategory(key));
}
}
@ -324,7 +327,6 @@ public void onDisable() {
config.unload();
}
this.getServer().getScheduler().cancelTasks(this);
worldEdit.getExecutorService().shutdown();
}
/**

View File

@ -213,7 +213,6 @@ public void onStopped() {
WorldEdit worldEdit = WorldEdit.getInstance();
worldEdit.getSessionManager().unload();
worldEdit.getPlatformManager().unregister(platform);
WorldEdit.getInstance().getExecutorService().shutdown();
}
public FileRegistries getFileRegistries() {

View File

@ -7,20 +7,6 @@
id("buildlogic.core-and-platform")
}
repositories {
ivy {
url = uri("https://repo.enginehub.org/language-files/")
name = "EngineHub Language Files"
patternLayout {
artifact("[organisation]/[module]/[revision]/[artifact]-[revision](+[classifier])(.[ext])")
setM2compatible(true)
}
metadataSources {
artifact()
}
}
}
configurations {
register("languageFiles")
}

View File

@ -33,12 +33,7 @@
import com.sk89q.worldedit.extension.platform.Actor;
import com.sk89q.worldedit.extension.platform.Capability;
import com.sk89q.worldedit.extension.platform.Locatable;
import com.sk89q.worldedit.function.RegionFunction;
import com.sk89q.worldedit.function.RegionMaskingFilter;
import com.sk89q.worldedit.function.block.ApplySideEffect;
import com.sk89q.worldedit.function.mask.Mask;
import com.sk89q.worldedit.function.operation.Operations;
import com.sk89q.worldedit.function.visitor.RegionVisitor;
import com.sk89q.worldedit.internal.annotation.Offset;
import com.sk89q.worldedit.internal.command.CommandRegistrationHandler;
import com.sk89q.worldedit.internal.command.CommandUtil;
@ -295,29 +290,6 @@ void perf(Actor actor, LocalSession session,
}
}
@Command(
name = "/update",
desc = "Apply side effects to your selection"
)
@CommandPermissions("worldedit.update")
void update(Actor actor, LocalSession session, World injectedWorld,
@Arg(desc = "The side effects", def = "")
SideEffectSet sideEffectSet) throws WorldEditException {
if (sideEffectSet == null) {
// Use defaults if none supplied.
sideEffectSet = SideEffectSet.defaults();
}
RegionFunction apply = new ApplySideEffect(injectedWorld, sideEffectSet);
if (session.getMask() != null) {
apply = new RegionMaskingFilter(session.getMask(), apply);
}
RegionVisitor visitor = new RegionVisitor(session.getSelection(injectedWorld), apply);
Operations.complete(visitor);
actor.printInfo(TranslatableComponent.of("worldedit.update"));
}
@Command(
name = "/reorder",
desc = "Sets the reorder mode of WorldEdit"

View File

@ -34,6 +34,8 @@
import com.sk89q.worldedit.extent.clipboard.BlockArrayClipboard;
import com.sk89q.worldedit.function.GroundFunction;
import com.sk89q.worldedit.function.RegionFunction;
import com.sk89q.worldedit.function.RegionMaskingFilter;
import com.sk89q.worldedit.function.block.ApplySideEffect;
import com.sk89q.worldedit.function.block.BlockReplace;
import com.sk89q.worldedit.function.generator.FloraGenerator;
import com.sk89q.worldedit.function.mask.ExistingBlockMask;
@ -59,6 +61,7 @@
import com.sk89q.worldedit.regions.Region;
import com.sk89q.worldedit.regions.RegionOperationException;
import com.sk89q.worldedit.session.ClipboardHolder;
import com.sk89q.worldedit.util.SideEffectSet;
import com.sk89q.worldedit.util.TreeGenerator.TreeType;
import com.sk89q.worldedit.util.formatting.component.TextUtils;
import com.sk89q.worldedit.util.formatting.text.Component;
@ -603,4 +606,26 @@ public int flora(Actor actor, EditSession editSession, @Selection Region region,
return affected;
}
@Command(
name = "/update",
desc = "Apply side effects to your selection"
)
@CommandPermissions("worldedit.update")
void update(Actor actor, LocalSession session, World injectedWorld,
@Arg(desc = "The side effects", def = "")
SideEffectSet sideEffectSet) throws WorldEditException {
if (sideEffectSet == null) {
// Use defaults if none supplied.
sideEffectSet = SideEffectSet.defaults();
}
RegionFunction apply = new ApplySideEffect(injectedWorld, sideEffectSet);
if (session.getMask() != null) {
apply = new RegionMaskingFilter(session.getMask(), apply);
}
RegionVisitor visitor = new RegionVisitor(session.getSelection(injectedWorld), apply);
Operations.complete(visitor);
actor.printInfo(TranslatableComponent.of("worldedit.update"));
}
}

View File

@ -31,14 +31,8 @@
}
repositories {
maven {
name = "EngineHub"
url = uri("https://maven.enginehub.org/repo/")
}
getByName("Mojang") {
content {
includeGroupAndSubgroups("com.mojang")
}
afterEvaluate {
verifyEngineHubRepositories()
}
}

View File

@ -218,38 +218,44 @@ private FabricPermissionsProvider getInitialPermissionsProvider() {
private void setupRegistries(MinecraftServer server) {
// Blocks
for (ResourceLocation name : server.registryAccess().registryOrThrow(Registries.BLOCK).keySet()) {
if (BlockType.REGISTRY.get(name.toString()) == null) {
BlockType.REGISTRY.register(name.toString(), new BlockType(name.toString(),
String key = name.toString();
if (BlockType.REGISTRY.get(key) == null) {
BlockType.REGISTRY.register(key, new BlockType(key,
input -> FabricAdapter.adapt(FabricAdapter.adapt(input.getBlockType()).defaultBlockState())));
}
}
// Items
for (ResourceLocation name : server.registryAccess().registryOrThrow(Registries.ITEM).keySet()) {
if (ItemType.REGISTRY.get(name.toString()) == null) {
ItemType.REGISTRY.register(name.toString(), new ItemType(name.toString()));
String key = name.toString();
if (ItemType.REGISTRY.get(key) == null) {
ItemType.REGISTRY.register(key, new ItemType(key));
}
}
// Entities
for (ResourceLocation name : server.registryAccess().registryOrThrow(Registries.ENTITY_TYPE).keySet()) {
if (EntityType.REGISTRY.get(name.toString()) == null) {
EntityType.REGISTRY.register(name.toString(), new EntityType(name.toString()));
String key = name.toString();
if (EntityType.REGISTRY.get(key) == null) {
EntityType.REGISTRY.register(key, new EntityType(key));
}
}
// Biomes
for (ResourceLocation name : server.registryAccess().registryOrThrow(Registries.BIOME).keySet()) {
if (BiomeType.REGISTRY.get(name.toString()) == null) {
BiomeType.REGISTRY.register(name.toString(), new BiomeType(name.toString()));
String key = name.toString();
if (BiomeType.REGISTRY.get(key) == null) {
BiomeType.REGISTRY.register(key, new BiomeType(key));
}
}
// Tags
server.registryAccess().registryOrThrow(Registries.BLOCK).getTagNames().map(TagKey::location).forEach(name -> {
if (BlockCategory.REGISTRY.get(name.toString()) == null) {
BlockCategory.REGISTRY.register(name.toString(), new BlockCategory(name.toString()));
String key = name.toString();
if (BlockCategory.REGISTRY.get(key) == null) {
BlockCategory.REGISTRY.register(key, new BlockCategory(key));
}
});
server.registryAccess().registryOrThrow(Registries.ITEM).getTagNames().map(TagKey::location).forEach(name -> {
if (ItemCategory.REGISTRY.get(name.toString()) == null) {
ItemCategory.REGISTRY.register(name.toString(), new ItemCategory(name.toString()));
String key = name.toString();
if (ItemCategory.REGISTRY.get(key) == null) {
ItemCategory.REGISTRY.register(key, new ItemCategory(key));
}
});
Registry<Biome> biomeRegistry = server.registryAccess().registryOrThrow(Registries.BIOME);
@ -269,14 +275,16 @@ private void setupRegistries(MinecraftServer server) {
});
// Features
for (ResourceLocation name : server.registryAccess().registryOrThrow(Registries.CONFIGURED_FEATURE).keySet()) {
if (ConfiguredFeatureType.REGISTRY.get(name.toString()) == null) {
ConfiguredFeatureType.REGISTRY.register(name.toString(), new ConfiguredFeatureType(name.toString()));
String key = name.toString();
if (ConfiguredFeatureType.REGISTRY.get(key) == null) {
ConfiguredFeatureType.REGISTRY.register(key, new ConfiguredFeatureType(key));
}
}
// Structures
for (ResourceLocation name : server.registryAccess().registryOrThrow(Registries.STRUCTURE).keySet()) {
if (StructureType.REGISTRY.get(name.toString()) == null) {
StructureType.REGISTRY.register(name.toString(), new StructureType(name.toString()));
String key = name.toString();
if (StructureType.REGISTRY.get(key) == null) {
StructureType.REGISTRY.register(key, new StructureType(key));
}
}
}
@ -299,7 +307,6 @@ private void onStopServer(MinecraftServer minecraftServer) {
WorldEdit worldEdit = WorldEdit.getInstance();
worldEdit.getSessionManager().unload();
WorldEdit.getInstance().getEventBus().post(new PlatformUnreadyEvent(platform));
WorldEdit.getInstance().getExecutorService().shutdown();
}
private boolean skipEvents() {

View File

@ -27,17 +27,15 @@
}
repositories {
val toRemove = mutableListOf<MavenArtifactRepository>()
for (repo in project.repositories) {
if (repo is MavenArtifactRepository && repo.url.toString() == "https://maven.neoforged.net/releases/") {
toRemove.add(repo)
}
}
toRemove.forEach { remove(it) }
maven {
name = "EngineHub"
url = uri("https://maven.enginehub.org/repo/")
}
mavenCentral()
killNonEngineHubRepositories()
afterEvaluate {
killNonEngineHubRepositories()
}
}
dependencies {
@ -72,6 +70,7 @@
parchment {
minecraftVersion = libs.versions.parchment.minecraft.get()
mappingsVersion = libs.versions.parchment.mappings.get()
addRepository = false
}
decompiler {
maxMemory("3G")

View File

@ -157,38 +157,44 @@ private void setupPlatform() {
private void setupRegistries(MinecraftServer server) {
// Blocks
for (ResourceLocation name : BuiltInRegistries.BLOCK.keySet()) {
if (BlockType.REGISTRY.get(name.toString()) == null) {
BlockType.REGISTRY.register(name.toString(), new BlockType(name.toString(),
String key = name.toString();
if (BlockType.REGISTRY.get(key) == null) {
BlockType.REGISTRY.register(key, new BlockType(key,
input -> NeoForgeAdapter.adapt(NeoForgeAdapter.adapt(input.getBlockType()).defaultBlockState())));
}
}
// Items
for (ResourceLocation name : BuiltInRegistries.ITEM.keySet()) {
if (ItemType.REGISTRY.get(name.toString()) == null) {
ItemType.REGISTRY.register(name.toString(), new ItemType(name.toString()));
String key = name.toString();
if (ItemType.REGISTRY.get(key) == null) {
ItemType.REGISTRY.register(key, new ItemType(key));
}
}
// Entities
for (ResourceLocation name : BuiltInRegistries.ENTITY_TYPE.keySet()) {
if (EntityType.REGISTRY.get(name.toString()) == null) {
EntityType.REGISTRY.register(name.toString(), new EntityType(name.toString()));
String key = name.toString();
if (EntityType.REGISTRY.get(key) == null) {
EntityType.REGISTRY.register(key, new EntityType(key));
}
}
// Biomes
for (ResourceLocation name : server.registryAccess().registryOrThrow(Registries.BIOME).keySet()) {
if (BiomeType.REGISTRY.get(name.toString()) == null) {
BiomeType.REGISTRY.register(name.toString(), new BiomeType(name.toString()));
String key = name.toString();
if (BiomeType.REGISTRY.get(key) == null) {
BiomeType.REGISTRY.register(key, new BiomeType(key));
}
}
// Tags
server.registryAccess().registryOrThrow(Registries.BLOCK).getTagNames().map(TagKey::location).forEach(name -> {
if (BlockCategory.REGISTRY.get(name.toString()) == null) {
BlockCategory.REGISTRY.register(name.toString(), new BlockCategory(name.toString()));
String key = name.toString();
if (BlockCategory.REGISTRY.get(key) == null) {
BlockCategory.REGISTRY.register(key, new BlockCategory(key));
}
});
server.registryAccess().registryOrThrow(Registries.ITEM).getTagNames().map(TagKey::location).forEach(name -> {
if (ItemCategory.REGISTRY.get(name.toString()) == null) {
ItemCategory.REGISTRY.register(name.toString(), new ItemCategory(name.toString()));
String key = name.toString();
if (ItemCategory.REGISTRY.get(key) == null) {
ItemCategory.REGISTRY.register(key, new ItemCategory(key));
}
});
Registry<Biome> biomeRegistry = server.registryAccess().registryOrThrow(Registries.BIOME);
@ -208,14 +214,16 @@ private void setupRegistries(MinecraftServer server) {
});
// Features
for (ResourceLocation name : server.registryAccess().registryOrThrow(Registries.CONFIGURED_FEATURE).keySet()) {
if (ConfiguredFeatureType.REGISTRY.get(name.toString()) == null) {
ConfiguredFeatureType.REGISTRY.register(name.toString(), new ConfiguredFeatureType(name.toString()));
String key = name.toString();
if (ConfiguredFeatureType.REGISTRY.get(key) == null) {
ConfiguredFeatureType.REGISTRY.register(key, new ConfiguredFeatureType(key));
}
}
// Structures
for (ResourceLocation name : server.registryAccess().registryOrThrow(Registries.STRUCTURE).keySet()) {
if (StructureType.REGISTRY.get(name.toString()) == null) {
StructureType.REGISTRY.register(name.toString(), new StructureType(name.toString()));
String key = name.toString();
if (StructureType.REGISTRY.get(key) == null) {
StructureType.REGISTRY.register(key, new StructureType(key));
}
}
}
@ -257,7 +265,6 @@ public void serverStopping(ServerStoppingEvent event) {
WorldEdit worldEdit = WorldEdit.getInstance();
worldEdit.getSessionManager().unload();
WorldEdit.getInstance().getEventBus().post(new PlatformUnreadyEvent(platform));
WorldEdit.getInstance().getExecutorService().shutdown();
}
@SubscribeEvent

View File

@ -18,15 +18,25 @@
banSlf4j = false
}
repositories {
mavenCentral()
}
minecraft {
injectRepositories(false)
version(libs.versions.sponge.minecraft.get())
}
repositories {
maven {
name = "EngineHub"
url = uri("https://maven.enginehub.org/repo/")
}
mavenCentral()
verifyEngineHubRepositories()
afterEvaluate {
verifyEngineHubRepositories()
}
}
sponge {
injectRepositories(false)
apiVersion(libs.versions.sponge.api.asProvider().get())
license("GPL-3.0-or-later")
plugin("worldedit") {

View File

@ -244,7 +244,6 @@ public void serverStopping(StoppingEngineEvent<Server> event) {
WorldEdit worldEdit = WorldEdit.getInstance();
worldEdit.getSessionManager().unload();
WorldEdit.getInstance().getEventBus().post(new PlatformUnreadyEvent(platform));
WorldEdit.getInstance().getExecutorService().shutdown();
}
@Listener