chore: update to 0.5.0

This commit is contained in:
Neil
2026-06-08 02:44:50 +05:30
committed by GitHub
parent fcba26deff
commit bb19417b47

View File

@@ -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()));
}
}
} }
} }