3
0
Mirror von https://github.com/Moulberry/AxiomPaperPlugin.git synchronisiert 2024-11-17 13:50:05 +01:00

Update to 1.20.2

Dieser Commit ist enthalten in:
Moulberry 2024-11-16 21:43:47 +08:00
Ursprung 6f77f8211b
Commit 8fee0bd403
6 geänderte Dateien mit 13 neuen und 7 gelöschten Zeilen

Datei anzeigen

@ -1,6 +1,7 @@
package com.moulberry.axiom;
import com.moulberry.axiom.packet.CustomByteArrayPayload;
import net.minecraft.network.FriendlyByteBuf;
import net.minecraft.network.protocol.common.ClientboundCustomPayloadPacket;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.server.level.ServerPlayer;
@ -11,6 +12,12 @@ public class VersionHelper {
serverPlayer.connection.send(new ClientboundCustomPayloadPacket(new CustomByteArrayPayload(id, data)));
}
public static void sendCustomPayload(ServerPlayer serverPlayer, ResourceLocation id, FriendlyByteBuf friendlyByteBuf) {
byte[] data = new byte[friendlyByteBuf.writerIndex()];
friendlyByteBuf.getBytes(friendlyByteBuf.readerIndex(), data);
sendCustomPayload(serverPlayer, id, data);
}
public static ResourceLocation createResourceLocation(String composed) {
return new ResourceLocation(composed);
}

Datei anzeigen

@ -17,7 +17,7 @@ import net.minecraft.network.FriendlyByteBuf;
import net.minecraft.world.level.block.state.BlockState;
import org.bukkit.Bukkit;
import org.bukkit.World;
import org.bukkit.craftbukkit.v1_20_R1.entity.CraftPlayer;
import org.bukkit.craftbukkit.v1_20_R2.entity.CraftPlayer;
import org.bukkit.entity.Player;
import java.util.List;

Datei anzeigen

@ -7,14 +7,13 @@ import com.moulberry.axiom.packet.PacketHandler;
import io.netty.buffer.Unpooled;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.network.FriendlyByteBuf;
import net.minecraft.network.protocol.game.ClientboundCustomPayloadPacket;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.server.level.ServerPlayer;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.player.Player;
import org.bukkit.Location;
import org.bukkit.craftbukkit.v1_20_R1.entity.CraftPlayer;
import org.bukkit.craftbukkit.v1_20_R2.entity.CraftPlayer;
import java.util.*;
@ -102,7 +101,7 @@ public class RequestEntityDataPacketListener implements PacketHandler {
friendlyByteBuf.writeBoolean(finished);
friendlyByteBuf.writeMap(map, (buf, uuid) -> buf.writeUUID(uuid), (buf, nbt) -> buf.writeNbt(nbt));
player.connection.send(new ClientboundCustomPayloadPacket(RESPONSE_ID, friendlyByteBuf));
VersionHelper.sendCustomPayload(player, RESPONSE_ID, friendlyByteBuf);
}
}

Datei anzeigen

@ -42,7 +42,7 @@ import net.minecraft.world.level.chunk.PalettedContainer;
import net.minecraft.world.level.levelgen.Heightmap;
import net.minecraft.world.level.lighting.LightEngine;
import org.bukkit.Location;
import org.bukkit.craftbukkit.v1_20_R1.entity.CraftPlayer;
import org.bukkit.craftbukkit.v1_20_R2.entity.CraftPlayer;
import org.bukkit.entity.Player;
import xyz.jpenilla.reflectionremapper.ReflectionRemapper;

Datei anzeigen

@ -6,7 +6,7 @@ import com.moulberry.axiom.annotations.ServerAnnotations;
import com.moulberry.axiom.packet.PacketHandler;
import net.minecraft.network.FriendlyByteBuf;
import net.minecraft.server.level.ServerPlayer;
import org.bukkit.craftbukkit.v1_20_R1.entity.CraftPlayer;
import org.bukkit.craftbukkit.v1_20_R2.entity.CraftPlayer;
import org.bukkit.entity.Player;
import java.util.ArrayList;

Datei anzeigen

@ -10,7 +10,7 @@ import net.minecraft.SharedConstants;
import net.minecraft.network.FriendlyByteBuf;
import net.minecraft.network.chat.Component;
import net.minecraft.server.level.ServerPlayer;
import org.bukkit.craftbukkit.v1_20_R1.entity.CraftPlayer;
import org.bukkit.craftbukkit.v1_20_R2.entity.CraftPlayer;
import org.bukkit.entity.Player;
import java.io.BufferedOutputStream;