Pin adapter version

This commit is contained in:
Madeline Miller 2021-12-12 19:57:14 +10:00
parent d0ecd8da78
commit 9409cc9700
No known key found for this signature in database
GPG Key ID: B8EA2E5693115D81
4 changed files with 8 additions and 5 deletions

View File

@ -4,11 +4,12 @@
// For specific version pinning, see
// https://papermc.io/repo/service/rest/repository/browse/maven-public/io/papermc/paper/dev-bundle/
fun Project.applyPaperweightAdapterConfiguration() {
fun Project.applyPaperweightAdapterConfiguration(javaRelease: Int = 16) {
applyCommonConfiguration()
apply(plugin = "java-library")
applyCommonJavaConfiguration(
sourcesJar = true,
javaRelease = javaRelease,
banSlf4j = false,
)
apply(plugin = "io.papermc.paperweight.userdev")

View File

@ -1,5 +1,5 @@
// TODO await https://github.com/PaperMC/paperweight/issues/116
//applyPaperweightAdapterConfiguration()
//applyPaperweightAdapterConfiguration(javaRelease = 16)
//
//dependencies {
// paperDevBundle("1.17.1-R0.1-20211120.192557-194")

View File

@ -1,4 +1,4 @@
applyPaperweightAdapterConfiguration()
applyPaperweightAdapterConfiguration(javaRelease = 17)
dependencies {
paperDevBundle("1.18-R0.1-20211130.173143-6")

View File

@ -30,6 +30,7 @@
import com.mojang.serialization.Codec;
import com.mojang.serialization.Dynamic;
import com.mojang.serialization.Lifecycle;
import com.sk89q.jnbt.AdventureNBTConverter;
import com.sk89q.jnbt.ByteArrayTag;
import com.sk89q.jnbt.ByteTag;
import com.sk89q.jnbt.CompoundTag;
@ -70,6 +71,7 @@
import com.sk89q.worldedit.util.formatting.text.Component;
import com.sk89q.worldedit.util.formatting.text.TranslatableComponent;
import com.sk89q.worldedit.util.io.file.SafeFiles;
import com.sk89q.worldedit.util.nbt.CompoundBinaryTag;
import com.sk89q.worldedit.world.DataFixer;
import com.sk89q.worldedit.world.RegenOptions;
import com.sk89q.worldedit.world.biome.BiomeType;
@ -499,13 +501,13 @@ public Component getRichItemName(BaseItemStack itemStack) {
}
@Override
public void sendFakeNBT(Player player, BlockVector3 pos, CompoundTag nbtData) {
public void sendFakeNBT(Player player, BlockVector3 pos, CompoundBinaryTag nbtData) {
((CraftPlayer) player).getHandle().networkManager.send(ClientboundBlockEntityDataPacket.create(
new StructureBlockEntity(
new BlockPos(pos.getBlockX(), pos.getBlockY(), pos.getBlockZ()),
Blocks.STRUCTURE_BLOCK.defaultBlockState()
),
__ -> (net.minecraft.nbt.CompoundTag) fromNative(nbtData)
__ -> (net.minecraft.nbt.CompoundTag) fromNative(AdventureNBTConverter.fromAdventure(nbtData))
));
}