-
Notifications
You must be signed in to change notification settings - Fork 16
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
base: master
Are you sure you want to change the base?
Feature/warning setting #43
Conversation
don't crash the whole bot when a client disconnects with an exception
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. |
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.*; |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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)"); |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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.
No description provided.