Skip to content

Commit

Permalink
[Sponge] 1.21.2
Browse files Browse the repository at this point in the history
  • Loading branch information
octylFractal committed Oct 23, 2024
1 parent 24f53a7 commit c582119
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 15 deletions.
9 changes: 5 additions & 4 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,17 @@ fabric-api = "0.106.1+1.21.2"
neogradle = "7.0.165"
neoforge-minecraft = "1.21.2"

sponge-minecraft = "1.21"
sponge-minecraft = "1.21.2"
# 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"
sponge-api = "13.0.0-20241022.030956-1"
sponge-api-major = "13"

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

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

# Minimum versions we apply to make dependencies support newer Java
minimumAsm = "9.7"
Expand Down Expand Up @@ -81,6 +81,7 @@ paperLib = "io.papermc:paperlib:1.0.8"

dummypermscompat = "com.sk89q:dummypermscompat:1.10"
bstats-bukkit = "org.bstats:bstats-bukkit:2.2.1"
bstats-sponge = "org.bstats:bstats-sponge:3.0.0"

trueZip = "de.schlichtherle:truezip:6.8.4"
rhino = "org.mozilla:rhino-runtime:1.7.13"
Expand Down
8 changes: 4 additions & 4 deletions worldedit-sponge/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,13 @@ dependencies {
"api"(project(":worldedit-core"))
"api"(project(":worldedit-libs:sponge"))

"api"("org.apache.logging.log4j:log4j-api")
"implementation"("org.bstats:bstats-sponge:3.0.0")
"implementation"("it.unimi.dsi:fastutil")
"api"(libs.log4j.api)
"implementation"(libs.bstats.sponge)
"implementation"(libs.fastutil)
"testImplementation"(libs.mockito.core)

// Silence some warnings, since apparently this isn't on the compile classpath like it should be.
"compileOnly"("com.google.errorprone:error_prone_annotations:2.11.0")
"compileOnly"(libs.errorprone.annotations)
}

configure<BasePluginExtension> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@
import org.spongepowered.api.entity.living.aquatic.Aquatic;
import org.spongepowered.api.entity.living.golem.Golem;
import org.spongepowered.api.entity.living.player.Player;
import org.spongepowered.api.entity.living.trader.Trader;
import org.spongepowered.api.entity.projectile.Projectile;
import org.spongepowered.api.entity.vehicle.Boat;
import org.spongepowered.api.entity.vehicle.minecart.Minecart;
import org.spongepowered.api.item.merchant.Merchant;

import static com.google.common.base.Preconditions.checkNotNull;

Expand Down Expand Up @@ -120,7 +120,7 @@ public boolean isAmbient() {

@Override
public boolean isNPC() {
return entity instanceof Trader;
return entity instanceof Merchant;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,10 @@

import com.sk89q.worldedit.blocks.BaseItemStack;
import com.sk89q.worldedit.util.formatting.text.Component;
import com.sk89q.worldedit.util.formatting.text.TranslatableComponent;
import com.sk89q.worldedit.util.formatting.text.serializer.gson.GsonComponentSerializer;
import com.sk89q.worldedit.world.item.ItemType;
import com.sk89q.worldedit.world.registry.BundledItemRegistry;
import net.minecraft.server.MinecraftServer;
import net.minecraft.world.item.ItemStack;
import org.spongepowered.api.ResourceKey;
import org.spongepowered.api.Sponge;
Expand All @@ -39,8 +40,11 @@ public Component getRichName(ItemType itemType) {

@Override
public Component getRichName(BaseItemStack itemStack) {
return TranslatableComponent.of(
((ItemStack) (Object) SpongeAdapter.adapt(itemStack)).getDescriptionId()
return GsonComponentSerializer.INSTANCE.deserialize(
net.minecraft.network.chat.Component.Serializer.toJson(
((ItemStack) (Object) SpongeAdapter.adapt(itemStack)).getItemName(),
((MinecraftServer) Sponge.server()).registryAccess()
)
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ public boolean regenerate(Region region, Extent extent, RegenOptions options) {
public boolean generateTree(TreeGenerator.TreeType type, EditSession editSession, BlockVector3 position) {
ServerLevel world = (ServerLevel) getWorld();
ConfiguredFeature<?, ?> generator = Optional.ofNullable(createTreeFeatureGenerator(type))
.map(k -> world.registryAccess().registryOrThrow(Registries.CONFIGURED_FEATURE).get(k))
.map(k -> world.registryAccess().lookupOrThrow(Registries.CONFIGURED_FEATURE).getValue(k))
.orElse(null);
return generator != null && generator.place(
world, world.getChunkSource().getGenerator(), random,
Expand Down Expand Up @@ -387,7 +387,7 @@ public void dropItem(Vector3 position, BaseItemStack item) {
);

itemEntity.item().set(
SpongeAdapter.adapt(item).createSnapshot()
SpongeAdapter.adapt(item).asImmutable()
);
getWorld().spawnEntity(itemEntity);
}
Expand Down

0 comments on commit c582119

Please sign in to comment.