Skip to content

Commit

Permalink
Merge branch '2.0' into feat/network-synced-registries
Browse files Browse the repository at this point in the history
  • Loading branch information
booky10 committed Jul 8, 2024
2 parents 4ab220f + 9d43fd7 commit 9fdd161
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
group = "com.github.retrooper"
description = rootProject.name
version = "2.4.0-SNAPSHOT" //TODO UPDATE - ADD "-SNAPSHOT" if we are dealing with snapshot versions
version = "2.4.1-SNAPSHOT" //TODO UPDATE - ADD "-SNAPSHOT" if we are dealing with snapshot versions

tasks {
wrapper {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public void onLoad() {
@Override
public void onEnable() {
// Register your listeners
PacketEvents.getAPI().getSettings().debug(false).checkForUpdates(true).timeStampMode(TimeStampMode.MILLIS).reEncodeByDefault(false);
PacketEvents.getAPI().getSettings().debug(false).checkForUpdates(true).timeStampMode(TimeStampMode.MILLIS);
PacketEvents.getAPI().init();
PacketListenerCommon listener = new PacketListenerAbstract(PacketListenerPriority.HIGH) {
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ protected void initChannel(@NotNull Channel channel) throws Exception {
if (!channel.isActive()) return;
INIT_CHANNEL_METHOD.invoke(oldInitializer, channel);

//No injection if no minecraft handlers are present
if (channel.pipeline().get("packet-decoder") == null) return;
if (channel.pipeline().get("packet-encoder") == null) return;

ServerConnectionInitializer.initChannel(channel, ConnectionState.HANDSHAKING);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public static void init() {
try {
DECODE_METHOD = ByteToMessageDecoder.class
.getDeclaredMethod("decode", ChannelHandlerContext.class,
ByteBuf.class, List.class);
Object.class, List.class);
DECODE_METHOD.setAccessible(true);
} catch (NoSuchMethodException e) {
e.printStackTrace();
Expand Down Expand Up @@ -153,7 +153,7 @@ public static List<Object> callPacketDecodeByteBuf(Object decoder, Object ctx, O
if (BUNGEE_PACKET_DECODE_BYTEBUF == null) {
try {
BUNGEE_PACKET_DECODE_BYTEBUF = decoder.getClass().getDeclaredMethod("decode", ChannelHandlerContext.class,
ByteBuf.class, List.class);
Object.class, List.class);
BUNGEE_PACKET_DECODE_BYTEBUF.setAccessible(true);
} catch (NoSuchMethodException e) {
e.printStackTrace();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import org.bukkit.material.MaterialData;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.Nullable;

import java.io.ByteArrayInputStream;
Expand Down Expand Up @@ -1062,7 +1063,7 @@ private static Entity getEntityByIdWithWorldUnsafe(World world, int id) {
}

@Nullable
@Deprecated
@ApiStatus.Internal
/**
* Get the entity by the id.
* @deprecated Please resort to {@link SpigotConversionUtil#getEntityById(World, int)} since the reflection util is not API.
Expand Down

0 comments on commit 9fdd161

Please sign in to comment.