backport1.20.1 #6

Zusammengeführt
YoyoNow hat 54 Commits von backport1.20.1 nach master 2024-02-01 19:58:32 +01:00 zusammengeführt
4 geänderte Dateien mit 13 neuen und 20 gelöschten Zeilen
Nur Änderungen aus Commit 1319a3d7c2 werden angezeigt - Alle Commits anzeigen

Datei anzeigen

@ -25,7 +25,7 @@ repositories {
} }
dependencies { 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") implementation("xyz.jpenilla:reflection-remapper:0.1.0-SNAPSHOT")
// Zstd Compression Library // 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.core.registries.Registries;
import net.minecraft.nbt.CompoundTag; import net.minecraft.nbt.CompoundTag;
import net.minecraft.network.FriendlyByteBuf; 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.ResourceKey;
import net.minecraft.resources.ResourceLocation; import net.minecraft.resources.ResourceLocation;
import net.minecraft.server.MinecraftServer; import net.minecraft.server.MinecraftServer;
@ -165,7 +165,7 @@ public class RequestChunkDataPacketListener implements PluginMessageListener {
buf.writeBoolean(false); buf.writeBoolean(false);
byte[] bytes = new byte[buf.writerIndex()]; byte[] bytes = new byte[buf.writerIndex()];
buf.getBytes(0, bytes); buf.getBytes(0, bytes);
player.connection.send(new ClientboundCustomPayloadPacket(new CustomByteArrayPayload(RESPONSE_ID, bytes))); player.connection.send(new ClientboundCustomPayloadPacket(RESPONSE_ID, buf));
// Continuation packet // Continuation packet
buf = new FriendlyByteBuf(Unpooled.buffer()); buf = new FriendlyByteBuf(Unpooled.buffer());
@ -185,7 +185,7 @@ public class RequestChunkDataPacketListener implements PluginMessageListener {
buf.writeBoolean(false); buf.writeBoolean(false);
byte[] bytes = new byte[buf.writerIndex()]; byte[] bytes = new byte[buf.writerIndex()];
buf.getBytes(0, bytes); buf.getBytes(0, bytes);
player.connection.send(new ClientboundCustomPayloadPacket(new CustomByteArrayPayload(RESPONSE_ID, bytes))); player.connection.send(new ClientboundCustomPayloadPacket(RESPONSE_ID, buf));
// Continuation packet // Continuation packet
buf = new FriendlyByteBuf(Unpooled.buffer()); buf = new FriendlyByteBuf(Unpooled.buffer());
@ -221,7 +221,7 @@ public class RequestChunkDataPacketListener implements PluginMessageListener {
buf.writeBoolean(false); buf.writeBoolean(false);
byte[] bytes = new byte[buf.writerIndex()]; byte[] bytes = new byte[buf.writerIndex()];
buf.getBytes(0, bytes); buf.getBytes(0, bytes);
player.connection.send(new ClientboundCustomPayloadPacket(new CustomByteArrayPayload(RESPONSE_ID, bytes))); player.connection.send(new ClientboundCustomPayloadPacket(RESPONSE_ID, buf));
// Continuation packet // Continuation packet
buf = new FriendlyByteBuf(Unpooled.buffer()); buf = new FriendlyByteBuf(Unpooled.buffer());
@ -241,7 +241,7 @@ public class RequestChunkDataPacketListener implements PluginMessageListener {
buf.writeBoolean(false); buf.writeBoolean(false);
byte[] bytes = new byte[buf.writerIndex()]; byte[] bytes = new byte[buf.writerIndex()];
buf.getBytes(0, bytes); buf.getBytes(0, bytes);
player.connection.send(new ClientboundCustomPayloadPacket(new CustomByteArrayPayload(RESPONSE_ID, bytes))); player.connection.send(new ClientboundCustomPayloadPacket(RESPONSE_ID, buf));
// Continuation packet // Continuation packet
buf = new FriendlyByteBuf(Unpooled.buffer()); buf = new FriendlyByteBuf(Unpooled.buffer());
@ -261,7 +261,7 @@ public class RequestChunkDataPacketListener implements PluginMessageListener {
buf.writeBoolean(true); buf.writeBoolean(true);
byte[] bytes = new byte[buf.writerIndex()]; byte[] bytes = new byte[buf.writerIndex()];
buf.getBytes(0, bytes); 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) { private void sendEmptyResponse(ServerPlayer player, long id) {
@ -273,7 +273,7 @@ public class RequestChunkDataPacketListener implements PluginMessageListener {
byte[] bytes = new byte[buf.writerIndex()]; byte[] bytes = new byte[buf.writerIndex()];
buf.getBytes(0, bytes); 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.Bukkit;
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.block.BlockFace; import org.bukkit.block.BlockFace;
<<<<<<< HEAD
import org.bukkit.craftbukkit.v1_20_R3.CraftWorld; import org.bukkit.craftbukkit.v1_20_R3.CraftWorld;
import org.bukkit.craftbukkit.v1_20_R3.block.CraftBlock; import org.bukkit.craftbukkit.v1_20_R3.block.CraftBlock;
import org.bukkit.craftbukkit.v1_20_R3.entity.CraftPlayer; 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.entity.Player;
import org.bukkit.event.block.Action; import org.bukkit.event.block.Action;
import org.bukkit.event.player.PlayerInteractEvent; import org.bukkit.event.player.PlayerInteractEvent;