Skip to content

Commit

Permalink
[Sponge] 1.21
Browse files Browse the repository at this point in the history
  • Loading branch information
octylFractal committed Jun 18, 2024
1 parent e15b59b commit 9c3f22a
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 7 deletions.
12 changes: 10 additions & 2 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ codecov = "org.enginehub.codecov:0.2.0"
neogradle-userdev = "net.neoforged.gradle.userdev:7.0.142"
fabric-loom = "fabric-loom:1.6.12"
sponge-spongegradle = "org.spongepowered.gradle.plugin:2.2.0"
sponge-vanillagradle = "org.spongepowered.gradle.vanilla:0.2.1-20240507.024226-82"
sponge-vanillagradle = { id = "org.spongepowered.gradle.vanilla", version.ref = "sponge-vanillagradle" }

[versions]
kyoriText = "3.0.4"
Expand All @@ -15,10 +15,18 @@ fabric-api = "0.100.3+1.21"

neoforge-minecraft = "1.21"

sponge-minecraft = "1.21"
# https://repo.spongepowered.org/service/rest/repository/browse/maven-public/org/spongepowered/spongeapi/
sponge-api = "12.0.0-20240616.151530-3"
sponge-api-major = "12"

# https://parchmentmc.org/docs/getting-started; note that we use older MC versions some times which is OK
parchment-minecraft = "1.20.6"
parchment-mappings = "2024.06.16"

# https://repo.spongepowered.org/service/rest/repository/browse/maven-public/org/spongepowered/vanillagradle/
sponge-vanillagradle = "0.2.1-20240617.053350-83"

# Minimum versions we apply to make dependencies support newer Java
minimumAsm = "9.7"
minimumJdependency = "2.10"
Expand All @@ -29,7 +37,7 @@ lang-version = "1450"

[libraries]
neogradle-neoform = "net.neoforged.gradle:neoform:7.0.142"
sponge-vanillagradle = "org.spongepowered:vanillagradle:0.2.1-20240507.024226-82"
sponge-vanillagradle = { module = "org.spongepowered:vanillagradle", version.ref = "sponge-vanillagradle" }

licenser = "gradle.plugin.org.cadixdev.gradle:licenser:0.6.1"
grgit = "org.ajoberstar.grgit:grgit-gradle:5.2.2"
Expand Down
8 changes: 3 additions & 5 deletions worldedit-sponge/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,11 @@ repositories {
}

minecraft {
version("1.20.6")
version(libs.versions.sponge.minecraft.get())
}

val spongeApiVersion = "11.0.0-20240520.134918-37";

sponge {
apiVersion(spongeApiVersion)
apiVersion(libs.versions.sponge.api.asProvider().get())
license("GPL-3.0-or-later")
plugin("worldedit") {
loader {
Expand Down Expand Up @@ -69,7 +67,7 @@ dependencies {
}

configure<BasePluginExtension> {
archivesName.set("${project.name}-api$spongeApiVersion")
archivesName.set("${project.name}-api${libs.versions.sponge.api.major.get()}")
}

tasks.named<ShadowJar>("shadowJar") {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import com.sk89q.worldedit.math.Vector3;
import com.sk89q.worldedit.regions.CuboidRegion;
import com.sk89q.worldedit.regions.Region;
import com.sk89q.worldedit.session.request.Request;
import com.sk89q.worldedit.sponge.internal.NbtAdapter;
import com.sk89q.worldedit.sponge.internal.SpongeWorldNativeAccess;
import com.sk89q.worldedit.util.Location;
Expand All @@ -44,6 +45,8 @@
import com.sk89q.worldedit.world.block.BaseBlock;
import com.sk89q.worldedit.world.block.BlockState;
import com.sk89q.worldedit.world.block.BlockStateHolder;
import com.sk89q.worldedit.world.generation.ConfiguredFeatureType;
import com.sk89q.worldedit.world.generation.StructureType;
import com.sk89q.worldedit.world.item.ItemTypes;
import com.sk89q.worldedit.world.weather.WeatherType;
import com.sk89q.worldedit.world.weather.WeatherTypes;
Expand Down Expand Up @@ -75,6 +78,8 @@
import org.spongepowered.api.world.BlockChangeFlags;
import org.spongepowered.api.world.LightTypes;
import org.spongepowered.api.world.SerializationBehavior;
import org.spongepowered.api.world.generation.feature.Features;
import org.spongepowered.api.world.generation.structure.Structures;
import org.spongepowered.api.world.server.ServerLocation;
import org.spongepowered.api.world.server.ServerWorld;
import org.spongepowered.api.world.server.WorldTemplate;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@
import com.sk89q.worldedit.world.biome.BiomeCategory;
import com.sk89q.worldedit.world.biome.BiomeType;
import com.sk89q.worldedit.world.block.BlockCategory;
import com.sk89q.worldedit.world.generation.ConfiguredFeatureType;
import com.sk89q.worldedit.world.generation.StructureType;
import com.sk89q.worldedit.world.item.ItemCategory;
import net.kyori.adventure.audience.Audience;
import org.apache.logging.log4j.Logger;
Expand Down Expand Up @@ -201,6 +203,21 @@ public void serverStarted(StartedEngineEvent<Server> event) {
});
}

// Disabled until https://github.com/SpongePowered/SpongeAPI/issues/2520 is resolved
// Will also need implementations in SpongeWorld to do placement
// Sponge.server().registry(RegistryTypes.FEATURE).streamEntries().forEach(feature -> {
// String id = feature.key().asString();
// if (!ConfiguredFeatureType.REGISTRY.keySet().contains(id)) {
// ConfiguredFeatureType.REGISTRY.register(id, new ConfiguredFeatureType(id));
// }
// });
// Sponge.server().registry(RegistryTypes.STRUCTURE).streamEntries().forEach(structure -> {
// String id = structure.key().asString();
// if (!StructureType.REGISTRY.keySet().contains(id)) {
// StructureType.REGISTRY.register(id, new StructureType(id));
// }
// });

event.game().registry(RegistryTypes.BLOCK_TYPE).tags().forEach(blockTypeTag -> {
String id = blockTypeTag.key().asString();
if (!BlockCategory.REGISTRY.keySet().contains(id)) {
Expand Down

0 comments on commit 9c3f22a

Please sign in to comment.