Skip to content

Commit

Permalink
Backport to 1.20.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Moulberry committed Oct 10, 2023
1 parent 3f613db commit 7c8f500
Show file tree
Hide file tree
Showing 13 changed files with 22 additions and 35 deletions.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ repositories {
}

dependencies {
paperweight.paperDevBundle("1.20.2-R0.1-20231010.011415-29")
paperweight.paperDevBundle("1.20.1-R0.1-SNAPSHOT")
implementation("xyz.jpenilla:reflection-remapper:0.1.0-SNAPSHOT")

// Zstd Compression Library
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/moulberry/axiom/AxiomPaper.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import net.minecraft.network.FriendlyByteBuf;
import net.minecraft.network.protocol.Packet;
import net.minecraft.network.protocol.PacketFlow;
import net.minecraft.network.protocol.common.ServerboundCustomPayloadPacket;
import net.minecraft.network.protocol.game.ServerboundCustomPayloadPacket;
import net.minecraft.resources.ResourceLocation;
import org.bukkit.*;
import org.bukkit.entity.Player;
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import org.bukkit.Bukkit;
import org.bukkit.NamespacedKey;
import org.bukkit.World;
import org.bukkit.craftbukkit.v1_20_R2.inventory.CraftItemStack;
import org.bukkit.craftbukkit.v1_20_R1.inventory.CraftItemStack;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import org.bukkit.persistence.PersistentDataContainer;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
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;
Expand All @@ -21,7 +21,7 @@
import net.minecraft.world.level.chunk.LevelChunk;
import net.minecraft.world.level.chunk.LevelChunkSection;
import net.minecraft.world.level.chunk.PalettedContainer;
import org.bukkit.craftbukkit.v1_20_R2.entity.CraftPlayer;
import org.bukkit.craftbukkit.v1_20_R1.entity.CraftPlayer;
import org.bukkit.entity.Player;
import org.bukkit.plugin.messaging.PluginMessageListener;
import org.jetbrains.annotations.NotNull;
Expand Down Expand Up @@ -149,7 +149,7 @@ public void onPluginMessageReceived(@NotNull String channel, @NotNull Player buk
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());
Expand All @@ -169,7 +169,7 @@ public void onPluginMessageReceived(@NotNull String channel, @NotNull Player buk
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());
Expand Down Expand Up @@ -205,7 +205,7 @@ public void onPluginMessageReceived(@NotNull String channel, @NotNull Player buk
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());
Expand All @@ -225,7 +225,7 @@ public void onPluginMessageReceived(@NotNull String channel, @NotNull Player buk
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());
Expand All @@ -245,7 +245,7 @@ public void onPluginMessageReceived(@NotNull String channel, @NotNull Player buk
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) {
Expand All @@ -257,7 +257,7 @@ private void sendEmptyResponse(ServerPlayer player, long id) {

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

}
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
import net.minecraft.world.phys.BlockHitResult;
import org.bukkit.Bukkit;
import org.bukkit.block.BlockFace;
import org.bukkit.craftbukkit.v1_20_R2.block.CraftBlock;
import org.bukkit.craftbukkit.v1_20_R2.entity.CraftPlayer;
import org.bukkit.craftbukkit.v1_20_R1.block.CraftBlock;
import org.bukkit.craftbukkit.v1_20_R1.entity.CraftPlayer;
import org.bukkit.entity.Player;
import org.bukkit.event.block.Action;
import org.bukkit.event.player.PlayerInteractEvent;
Expand All @@ -38,7 +38,6 @@
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.logging.Level;

public class SetBlockPacketListener implements PluginMessageListener {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import io.netty.buffer.Unpooled;
import net.minecraft.network.FriendlyByteBuf;
import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_20_R2.entity.CraftPlayer;
import org.bukkit.craftbukkit.v1_20_R1.entity.CraftPlayer;
import org.bukkit.entity.Player;
import org.bukkit.plugin.messaging.PluginMessageListener;
import org.jetbrains.annotations.NotNull;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import net.minecraft.world.level.GameType;
import org.bukkit.Bukkit;
import org.bukkit.GameMode;
import org.bukkit.craftbukkit.v1_20_R2.entity.CraftPlayer;
import org.bukkit.craftbukkit.v1_20_R1.entity.CraftPlayer;
import org.bukkit.entity.Player;
import org.bukkit.plugin.messaging.PluginMessageListener;
import org.jetbrains.annotations.NotNull;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
import io.netty.buffer.Unpooled;
import net.minecraft.network.FriendlyByteBuf;
import org.bukkit.NamespacedKey;
import org.bukkit.craftbukkit.v1_20_R2.entity.CraftPlayer;
import org.bukkit.craftbukkit.v1_20_R2.inventory.CraftItemStack;
import org.bukkit.craftbukkit.v1_20_R1.entity.CraftPlayer;
import org.bukkit.craftbukkit.v1_20_R1.inventory.CraftItemStack;
import org.bukkit.entity.Player;
import org.bukkit.persistence.PersistentDataContainer;
import org.bukkit.persistence.PersistentDataType;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import net.minecraft.world.level.GameRules;
import net.minecraft.world.level.Level;
import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_20_R2.CraftWorld;
import org.bukkit.craftbukkit.v1_20_R1.CraftWorld;
import org.bukkit.entity.Player;
import org.bukkit.plugin.messaging.PluginMessageListener;
import org.jetbrains.annotations.NotNull;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import org.bukkit.GameMode;
import org.bukkit.Material;
import org.bukkit.NamespacedKey;
import org.bukkit.craftbukkit.v1_20_R2.inventory.CraftItemStack;
import org.bukkit.craftbukkit.v1_20_R1.inventory.CraftItemStack;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import org.bukkit.persistence.PersistentDataContainer;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.moulberry.axiom.persistence;

import net.minecraft.nbt.CompoundTag;
import org.bukkit.craftbukkit.v1_20_R2.inventory.CraftItemStack;
import org.bukkit.craftbukkit.v1_20_R2.persistence.CraftPersistentDataContainer;
import org.bukkit.craftbukkit.v1_20_R1.inventory.CraftItemStack;
import org.bukkit.craftbukkit.v1_20_R1.persistence.CraftPersistentDataContainer;
import org.bukkit.inventory.ItemStack;
import org.bukkit.persistence.PersistentDataAdapterContext;
import org.bukkit.persistence.PersistentDataContainer;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import net.minecraft.world.level.GameRules;
import org.bukkit.GameRule;
import org.bukkit.World;
import org.bukkit.craftbukkit.v1_20_R2.CraftWorld;
import org.bukkit.craftbukkit.v1_20_R1.CraftWorld;
import org.bukkit.entity.Player;
import org.bukkit.plugin.Plugin;

Expand Down

0 comments on commit 7c8f500

Please sign in to comment.