Backport to 1.20.1

Dieser Commit ist enthalten in:
Moulberry 2023-10-10 13:07:49 +08:00 committet von yoyosource
Ursprung 9ba82ce6a7
Commit 1319a3d7c2
4 geänderte Dateien mit 13 neuen und 20 gelöschten Zeilen

Datei anzeigen

@ -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

Datei anzeigen

@ -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);
}
}

Datei anzeigen

@ -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));
}
}

Datei anzeigen

@ -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;