Skip to content

Commit

Permalink
chore: make a todo
Browse files Browse the repository at this point in the history
  • Loading branch information
RealBauHD committed Sep 11, 2024
1 parent 2369b4e commit fbff839
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,16 @@
import io.github.sculkpowered.server.registry.Registry;
import io.github.sculkpowered.server.util.MojangUtil;
import io.github.sculkpowered.server.world.SculkWorld;
import io.github.sculkpowered.server.world.World;
import io.github.sculkpowered.server.world.WorldLoader;
import io.netty.channel.Channel;
import io.netty.channel.ChannelFutureListener;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelInboundHandlerAdapter;
import io.netty.util.ReferenceCountUtil;
import java.net.SocketAddress;
import java.nio.charset.StandardCharsets;
import java.nio.file.Path;
import java.security.GeneralSecurityException;
import java.util.Collection;
import java.util.List;
Expand Down Expand Up @@ -181,6 +184,7 @@ public void configuration() {
this.send(new RegistryDataPacket(Registries.dimensions()));
this.send(new RegistryDataPacket(Registries.damageTypes()));
this.send(new RegistryDataPacket(Registries.enchantments()));
// TODO: this would be a part of the registry rewrite
this.send(new RegistryDataPacket(new Registry<>() {
@Override
public @NotNull String type() {
Expand Down Expand Up @@ -276,10 +280,10 @@ public int id() {
}

public void play() {
final var world = (SculkWorld) this.server.createWorld(World.builder().name("aaaa").loader(WorldLoader.anvil(Path.of("world"))));
this.setState(State.PLAY);
this.server.eventHandler().call(new PlayerInitialEvent(this.player))
.thenAcceptAsync(event -> {
final var world = (SculkWorld) event.world();
var position = event.position();
if (world == null || !world.isAlive()) {
this.player.disconnect(Component.text("No world found.", NamedTextColor.RED));
Expand Down

0 comments on commit fbff839

Please sign in to comment.