chore: update to 0.5.0
This commit is contained in:
@@ -7,8 +7,15 @@ import com.hypixel.hytale.server.core.event.events.player.PlayerReadyEvent;
|
|||||||
public class ExampleEvent {
|
public class ExampleEvent {
|
||||||
|
|
||||||
public static void onPlayerReady(PlayerReadyEvent event) {
|
public static void onPlayerReady(PlayerReadyEvent event) {
|
||||||
Player player = event.getPlayer();
|
Ref<EntityStore> ref = event.getPlayerRef();
|
||||||
player.sendMessage(Message.raw("Welcome " + player.getDisplayName()));
|
|
||||||
|
if (ref.isValid()) {
|
||||||
|
Store<EntityStore> store = ref.getStore();
|
||||||
|
PlayerRef playerRef = store.getComponent(ref, PlayerRef.getComponentType());
|
||||||
|
if (playerRef != null) {
|
||||||
|
playerRef.sendMessage(Message.raw("Welcome " + playerRef.getUsername()));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user