docs: 更新代码示例
This commit is contained in:
@@ -179,11 +179,10 @@ public class BallListener {
|
|||||||
if (!"GlobalChat".equals(event.getChannel())) {
|
if (!"GlobalChat".equals(event.getChannel())) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
BallMessage ballMessage = event.getMessage();
|
String action = event.getAction();
|
||||||
String action = ballMessage.getAction();
|
|
||||||
switch (action) {
|
switch (action) {
|
||||||
case "onPlayerChat": {
|
case "onPlayerChat": {
|
||||||
JsonObject object = ballMessage.getContentAsJsonObject();
|
JsonObject object = event.getContentAsJsonObject();
|
||||||
String name = object.get("name").getAsString();
|
String name = object.get("name").getAsString();
|
||||||
String message = object.get("message").getAsString();
|
String message = object.get("message").getAsString();
|
||||||
String world = object.get("world").getAsString();
|
String world = object.get("world").getAsString();
|
||||||
|
Reference in New Issue
Block a user