-
Notifications
You must be signed in to change notification settings - Fork 356
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
Implement chat changes #1172
Closed
Closed
Implement chat changes #1172
Changes from 1 commit
Commits
Show all changes
64 commits
Select commit
Hold shift + click to select a range
4550b47
1.19
TheMode 2617257
Fix system message
TheMode 19871ec
Copy chat registry from vanilla
TheMode 3bef4f8
Listener for ClientCommandChatPacket
TheMode ede16bd
Add ClientChatPreviewPacket
TheMode 9ebcfe6
Add ServerDataPacket
TheMode bf602b5
Fix ClientChatPreviewPacket
TheMode d919fac
Register temporary metadata for 1.19 entities
TheMode 4440f39
Fix PlayerChatMessagePacket
Kebab11noel cb679b5
use raw type id instead of ChatPosition
TheMode 2d38bef
Fix test compile
TheMode a282c9f
Implement PlayerPublicKey parsing and verification
Kebab11noel d626eb0
Inline expiration check
Kebab11noel cb5b9d4
Simplify validator names
Kebab11noel 8424679
Distribute public keys
Kebab11noel c4b5a20
Add convenience methods
Kebab11noel 6b489b5
Signature forwarding works
Kebab11noel 960d5c8
Update convenience methods
Kebab11noel 11ba78a
Implement chat preview toggling and event
Kebab11noel 4ee6985
Add signature to chat event
Kebab11noel ab84bd6
Implement Component signature verification
Kebab11noel d0a7f45
Move preview listener into ChatMessageListener
Kebab11noel 533bb49
Chat handling done
Kebab11noel 192b6de
Cleanup
Kebab11noel b0e0da0
New line
Kebab11noel 24c3fbf
Document SignatureValidator
Kebab11noel 74ceb81
Add chat preview command
Kebab11noel 29c5d1d
Correct name
Kebab11noel fa9ab30
Move uuid into MessageSignature from MessageSender
Kebab11noel f81b310
Rename constructor param
Kebab11noel 0a68dac
Add util methods
Kebab11noel e770509
Move signatures to different record to be used in command context
Kebab11noel 4a04d16
Command argument signing, TODO: Check where is it necessary to pass t…
Kebab11noel c3960e6
Better debug commands
Kebab11noel 7c33dd9
Initial chat registry
Kebab11noel 77b5df0
Finish chat registry descriptor objects
Kebab11noel d2ccf82
Add translation key matching
Kebab11noel c9b2c01
Create ObjectCache
Kebab11noel 9b6c277
Add name based lookup and register defaults
Kebab11noel 4c5731e
Deprecate ChatPosition, extend Messenger, add CommonChatType, rename …
Kebab11noel cd23975
Use nullable methods
Kebab11noel e2b2401
Fix annotations
Kebab11noel f9eb273
Cleanup CommandSignTest
Kebab11noel 5d1e3e8
Deprecate Player#chat
Kebab11noel 3923277
Update getter name
Kebab11noel 2a48916
Use else get
Kebab11noel 4c90af5
Use else get
Kebab11noel 6145a9f
Use nullable writer
Kebab11noel 45d1d19
Fix type
Kebab11noel 5175384
Fix preview
Kebab11noel 418edc0
Fix ArgumentMessage
Kebab11noel 7fe4334
Use interface for ChatType, and register using nbt
Kebab11noel 47f28a3
Clear preview on command
Kebab11noel ecff687
Cleanup command changes, fix caching issue
Kebab11noel 0cfdde0
Cleanup, minor changes
Kebab11noel 87dda18
Improve isSet logic, add utils
Kebab11noel 61cd9d1
Implement config manager
Kebab11noel 1127a98
Fix tests
Kebab11noel 908d39e
Move chat types to config
Kebab11noel aa8b798
Remove CommonChatType.java
Kebab11noel 4050265
Rework registry
Kebab11noel 8fd6644
Improve registry design
Kebab11noel 6f36d24
Address styling issues
Kebab11noel ea3936b
Rework config
Kebab11noel File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
package net.minestom.server; | ||
|
||
import net.kyori.adventure.text.Component; | ||
import net.kyori.adventure.text.format.NamedTextColor; | ||
import net.minestom.server.registry.dynamic.chat.ChatDecoration; | ||
import net.minestom.server.registry.dynamic.chat.ChatType; | ||
import net.minestom.server.registry.dynamic.chat.ChatTypeBuilder; | ||
|
||
public record Configuration(boolean requireValidPlayerPublicKey, Component missingPlayerPublicKeyMessage, | ||
Component invalidPlayerPublicKeyMessage, ChatTypeBuilder playerChatType, | ||
ChatTypeBuilder systemChatType) { | ||
|
||
public static Builder builder() { | ||
return new Builder(); | ||
} | ||
|
||
public static class Builder { | ||
private boolean requireValidPlayerPublicKey = false; | ||
private Component missingPlayerPublicKeyMessage = Component.text("Missing public key!", NamedTextColor.RED); | ||
private Component invalidPlayerPublicKeyMessage = Component.text("Invalid public key!", NamedTextColor.RED); | ||
private ChatTypeBuilder playerChatType = ChatTypeBuilder.builder(ChatType.CHAT.key()).chat(ChatDecoration.contentWithSender("chat.type.text")); | ||
private ChatTypeBuilder systemChatType = ChatTypeBuilder.builder(ChatType.SYSTEM.key()).chat(); | ||
|
||
public Builder setRequireValidPlayerPublicKey(boolean requireValidPlayerPublicKey) { | ||
this.requireValidPlayerPublicKey = requireValidPlayerPublicKey; | ||
return this; | ||
} | ||
|
||
public Builder setMissingPlayerPublicKeyMessage(Component missingPlayerPublicKeyMessage) { | ||
this.missingPlayerPublicKeyMessage = missingPlayerPublicKeyMessage; | ||
return this; | ||
} | ||
|
||
public Builder setInvalidPlayerPublicKeyMessage(Component invalidPlayerPublicKeyMessage) { | ||
this.invalidPlayerPublicKeyMessage = invalidPlayerPublicKeyMessage; | ||
return this; | ||
} | ||
|
||
public Builder setPlayerChatType(ChatTypeBuilder playerChatType) { | ||
this.playerChatType = playerChatType; | ||
return this; | ||
} | ||
|
||
public Builder setSystemChatType(ChatTypeBuilder systemChatType) { | ||
this.systemChatType = systemChatType; | ||
return this; | ||
} | ||
|
||
public Configuration build() { | ||
return new Configuration(requireValidPlayerPublicKey, missingPlayerPublicKeyMessage, invalidPlayerPublicKeyMessage, playerChatType, systemChatType); | ||
} | ||
} | ||
} |
30 changes: 0 additions & 30 deletions
30
src/main/java/net/minestom/server/ConfigurationManager.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Don't most of the other builders in Minestom omit the
set
prefix?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.
I'll change that, and this config change will be made in master first