diff --git a/build.gradle.kts b/build.gradle.kts index 91d0d4e..24ecb7a 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -25,7 +25,7 @@ repositories { } dependencies { - paperweight.paperDevBundle("1.20.4-R0.1-SNAPSHOT") + paperweight.paperDevBundle("1.20.1-R0.1-SNAPSHOT") implementation("xyz.jpenilla:reflection-remapper:0.1.0-SNAPSHOT") // Zstd Compression Library diff --git a/src/main/java/com/moulberry/axiom/packet/CustomByteArrayPayload.java b/src/main/java/com/moulberry/axiom/packet/CustomByteArrayPayload.java deleted file mode 100644 index cb2bcd7..0000000 --- a/src/main/java/com/moulberry/axiom/packet/CustomByteArrayPayload.java +++ /dev/null @@ -1,12 +0,0 @@ -package com.moulberry.axiom.packet; - -import net.minecraft.network.FriendlyByteBuf; -import net.minecraft.network.protocol.common.custom.CustomPacketPayload; -import net.minecraft.resources.ResourceLocation; - -public record CustomByteArrayPayload(ResourceLocation id, byte[] bytes) implements CustomPacketPayload { - @Override - public void write(FriendlyByteBuf buf) { - buf.writeBytes(bytes); - } -} diff --git a/src/main/java/com/moulberry/axiom/packet/RequestChunkDataPacketListener.java b/src/main/java/com/moulberry/axiom/packet/RequestChunkDataPacketListener.java index de6a6b3..f82c231 100644 --- a/src/main/java/com/moulberry/axiom/packet/RequestChunkDataPacketListener.java +++ b/src/main/java/com/moulberry/axiom/packet/RequestChunkDataPacketListener.java @@ -11,7 +11,7 @@ import net.minecraft.core.BlockPos; import net.minecraft.core.registries.Registries; import net.minecraft.nbt.CompoundTag; import net.minecraft.network.FriendlyByteBuf; -import net.minecraft.network.protocol.common.ClientboundCustomPayloadPacket; +import net.minecraft.network.protocol.game.ClientboundCustomPayloadPacket; import net.minecraft.resources.ResourceKey; import net.minecraft.resources.ResourceLocation; import net.minecraft.server.MinecraftServer; @@ -165,7 +165,7 @@ public class RequestChunkDataPacketListener implements PluginMessageListener { buf.writeBoolean(false); byte[] bytes = new byte[buf.writerIndex()]; buf.getBytes(0, bytes); - player.connection.send(new ClientboundCustomPayloadPacket(new CustomByteArrayPayload(RESPONSE_ID, bytes))); + player.connection.send(new ClientboundCustomPayloadPacket(RESPONSE_ID, buf)); // Continuation packet buf = new FriendlyByteBuf(Unpooled.buffer()); @@ -185,7 +185,7 @@ public class RequestChunkDataPacketListener implements PluginMessageListener { buf.writeBoolean(false); byte[] bytes = new byte[buf.writerIndex()]; buf.getBytes(0, bytes); - player.connection.send(new ClientboundCustomPayloadPacket(new CustomByteArrayPayload(RESPONSE_ID, bytes))); + player.connection.send(new ClientboundCustomPayloadPacket(RESPONSE_ID, buf)); // Continuation packet buf = new FriendlyByteBuf(Unpooled.buffer()); @@ -221,7 +221,7 @@ public class RequestChunkDataPacketListener implements PluginMessageListener { buf.writeBoolean(false); byte[] bytes = new byte[buf.writerIndex()]; buf.getBytes(0, bytes); - player.connection.send(new ClientboundCustomPayloadPacket(new CustomByteArrayPayload(RESPONSE_ID, bytes))); + player.connection.send(new ClientboundCustomPayloadPacket(RESPONSE_ID, buf)); // Continuation packet buf = new FriendlyByteBuf(Unpooled.buffer()); @@ -241,7 +241,7 @@ public class RequestChunkDataPacketListener implements PluginMessageListener { buf.writeBoolean(false); byte[] bytes = new byte[buf.writerIndex()]; buf.getBytes(0, bytes); - player.connection.send(new ClientboundCustomPayloadPacket(new CustomByteArrayPayload(RESPONSE_ID, bytes))); + player.connection.send(new ClientboundCustomPayloadPacket(RESPONSE_ID, buf)); // Continuation packet buf = new FriendlyByteBuf(Unpooled.buffer()); @@ -261,7 +261,7 @@ public class RequestChunkDataPacketListener implements PluginMessageListener { buf.writeBoolean(true); byte[] bytes = new byte[buf.writerIndex()]; buf.getBytes(0, bytes); - player.connection.send(new ClientboundCustomPayloadPacket(new CustomByteArrayPayload(RESPONSE_ID, bytes))); + player.connection.send(new ClientboundCustomPayloadPacket(RESPONSE_ID, buf)); } private void sendEmptyResponse(ServerPlayer player, long id) { @@ -273,7 +273,7 @@ public class RequestChunkDataPacketListener implements PluginMessageListener { byte[] bytes = new byte[buf.writerIndex()]; buf.getBytes(0, bytes); - player.connection.send(new ClientboundCustomPayloadPacket(new CustomByteArrayPayload(RESPONSE_ID, bytes))); + player.connection.send(new ClientboundCustomPayloadPacket(RESPONSE_ID, buf)); } } diff --git a/src/main/java/com/moulberry/axiom/packet/SetBlockPacketListener.java b/src/main/java/com/moulberry/axiom/packet/SetBlockPacketListener.java index 493249a..9ede7a7 100644 --- a/src/main/java/com/moulberry/axiom/packet/SetBlockPacketListener.java +++ b/src/main/java/com/moulberry/axiom/packet/SetBlockPacketListener.java @@ -31,9 +31,14 @@ import net.minecraft.world.phys.BlockHitResult; import org.bukkit.Bukkit; import org.bukkit.Location; import org.bukkit.block.BlockFace; +<<<<<<< HEAD import org.bukkit.craftbukkit.v1_20_R3.CraftWorld; import org.bukkit.craftbukkit.v1_20_R3.block.CraftBlock; import org.bukkit.craftbukkit.v1_20_R3.entity.CraftPlayer; +======= +import org.bukkit.craftbukkit.v1_20_R1.block.CraftBlock; +import org.bukkit.craftbukkit.v1_20_R1.entity.CraftPlayer; +>>>>>>> 7c8f500 (Backport to 1.20.1) import org.bukkit.entity.Player; import org.bukkit.event.block.Action; import org.bukkit.event.player.PlayerInteractEvent;