Skip to content

Commit

Permalink
Update fields to match neoforge class
Browse files Browse the repository at this point in the history
  • Loading branch information
roddolf committed Sep 15, 2024
1 parent 6ecbe97 commit cf5eef1
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,16 @@
public abstract class ConnectionMixin {
@Final
@Shadow
private Function<Object, ?> packetIdGetter;
private Function<Object, ?> typeGetter;

@Final
@Shadow
private Object2IntMap<Object> typeToIndex;
private Object2IntMap<Object> toId;

@Inject(at = @At("HEAD"), method = "encode(Lio/netty/buffer/ByteBuf;Ljava/lang/Object;)V", cancellable = true)
private void encodeMixin(ByteBuf byteBuf, Object object, CallbackInfo info) {
var packetId = this.packetIdGetter.apply(object);
if (!this.typeToIndex.containsKey(packetId)) {
if (!this.toId.containsKey(packetId)) {
if (Objects.equals(String.valueOf(packetId), "clientbound/minecraft:disconnect")) {
DisconnectPacketFixMod.LOGGER.debug("Caught an invalid disconnect packet.");
info.cancel();
Expand Down

0 comments on commit cf5eef1

Please sign in to comment.