Skip to content

Conversation

@DemonDxv
Copy link

@DemonDxv DemonDxv commented Oct 8, 2025

No description provided.


package com.github.retrooper.packetevents.protocol.player;

public enum InteractAction {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

…layer/InteractAction.java

Removed as it was useless
import com.github.retrooper.packetevents.manager.server.ServerVersion;
import com.github.retrooper.packetevents.netty.buffer.ByteBufHelper;
import com.github.retrooper.packetevents.netty.buffer.ByteBufInputStream;
import com.github.retrooper.packetevents.netty.buffer.ByteBufOperator;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don’t get why these imports need to be in this class.
Why did you touch this class at all? Nothing’s really been added.
Also, your TODO comment should probably be an issue instead.

Removed TODO comment regarding byte buffer handling for malformed packets.
@booky10
Copy link
Collaborator

booky10 commented Nov 3, 2025

I'm not really a fan of adding yet more of these "UNKNOWN" enum states
Idk what @retrooper thinks, but in my opinion making them nullable seems like a more appropiate solution then adding an enum value which doesn't actually exist

@NoJokeFNA
Copy link
Contributor

I actually like this approach. IMO it’s better to check if the enum is UNKNOWN than to handle nulls or exceptions. proto3 does something similar — it uses UNRECOGNIZED.

@DemonDxv
Copy link
Author

DemonDxv commented Nov 4, 2025

I'm not really a fan of adding yet more of these "UNKNOWN" enum states Idk what @retrooper thinks, but in my opinion making them nullable seems like a more appropiate solution then adding an enum value which doesn't actually exist

I wouldn't of made this poll request if I didn't think it would benefit everyone, if you continue to leave it as is, people can just bot a server with pe 2.0 and send invalid packet data spamming the console with errors. I also noticed that even legit players get kicked and console error for these. One of the major ones was the TODO that i could not fix but since removed. Many legits kept erroring packetevents for index out of bounds based on the face value pe would read.

@retrooper
Copy link
Owner

Thanks for the PR.

@retrooper retrooper self-requested a review November 5, 2025 07:37
Copy link
Owner

@retrooper retrooper left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of adding 'UNKNOWN' fields to every enum, let's have the methods that get an enum from an ID return null if the ID is invalid. I think this is the best move here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants