Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/warning setting #43

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

IronException
Copy link
Contributor

No description provided.

@IronException
Copy link
Contributor Author

oh damn, I forgot a description: a friend wanted to use the proxy for his server but had a plugin that sent him a position rotation packet for an invalid entity all the time. So we added a setting to dismiss warnings.
He also tried to use the proxy on a 1.16.4 server (that uses protocol support so the proxy should be able to connect). However, we noticed that the ServerEntityMetadataPacket got sent for players unlike in old versions. This crashed the proxy because you can't add elements to java.Util.Arrays$ArrayList because it extends from AbstractList that throws an UnsupportedOperationException when you try to add. We didn't know how to fix this properly so we just send a warning when this happens.
This leads to the proxy not saving when other players are sneaking eg.

import net.daporkchop.toobeetooteebot.client.handler.incoming.spawn.SpawnPlayerHandler;
import net.daporkchop.toobeetooteebot.client.handler.incoming.*;
import net.daporkchop.toobeetooteebot.client.handler.incoming.entity.*;
import net.daporkchop.toobeetooteebot.client.handler.incoming.spawn.*;
Copy link
Member

Choose a reason for hiding this comment

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

code style: no wildcard class imports

@@ -41,7 +41,7 @@ public boolean apply(@NonNull ServerEntityAttachPacket packet, @NonNull PorkClie
} else {
entity.setLeashed(true).setLeashedId(packet.getAttachedToId());
}
} else {
} else if(CONFIG.log.sendWarning) {
Copy link
Member

Choose a reason for hiding this comment

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

code style: use a space after if

(repeated many, many times)

entity.getMetadata().add(metadata);
} else if(CONFIG.log.sendWarning) {
// TODO make that info less
CLIENT_LOG.warn("Received ServerEntityMetadataPacket for an entity that cant accept those (probably happened because you are on a 1.16 server. You can't see the sneaking of other players now eg)");
Copy link
Member

Choose a reason for hiding this comment

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

this is a really hacky workaround, for a variety of reasons:

  • pork2b2tbot doesn't support 1.16. if you have a custom fork that adds support then this belongs on that fork
  • this should be fixed by changing the list implementation used to be an ArrayList. there's no reason to work around such a trivial fix

@@ -78,7 +78,7 @@ public Column get(int x, int z) {

public void remove(int x, int z) {
CACHE_LOG.debug("Server telling us to uncache chunk (%d, %d)", x, z);
if (this.cache.remove(new Vec2i(x, z)) == null) {
if (this.cache.remove(new Vec2i(x, z)) == null && CONFIG.log.sendWarning) {
Copy link
Member

Choose a reason for hiding this comment

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

this message should be being printed: the only things that should be able to cause it are be a bug in the server or a bug in the bot.

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.

2 participants