mirror of
https://github.com/GTNewHorizons/CraftTweaker.git
synced 2026-11-28 07:35:40 +00:00
Add a chat message length limit to avoid crashing with too big packets sent to clients.
This commit is contained in:
1 parent
236744c74e
commit
8abb3efbfb
6 files changed
+42
-24
No files matched your search
@@ -37,22 +37,22 @@ public class CommandBlockPlayer implements IPlayer{
|
||||
public IData getData(){
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getXP() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void setXP(int xp) {
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void removeXP(int xp) {
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void update(IData data){
|
||||
|
||||
@@ -70,6 +70,10 @@ public class CommandBlockPlayer implements IPlayer{
|
||||
|
||||
@Override
|
||||
public void sendChat(String message){
|
||||
if (message.length() > MAX_CHAT_MESSAGE_LENGTH)
|
||||
{
|
||||
message = message.substring(0, MAX_CHAT_MESSAGE_LENGTH);
|
||||
}
|
||||
sender.addChatMessage(new ChatComponentText(message));
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user