diff --git a/build.gradle b/build.gradle index 71ced47..99c587b 100644 --- a/build.gradle +++ b/build.gradle @@ -30,14 +30,14 @@ dependencies { testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.0' testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.10.0' - compileOnly 'org.geysermc.geyser:api:2.3.0-SNAPSHOT' - compileOnly('org.geysermc.geyser:core:2.3.0-SNAPSHOT') { + compileOnly 'org.geysermc.geyser:api:2.4.1-SNAPSHOT' + compileOnly('org.geysermc.geyser:core:2.4.1-SNAPSHOT') { exclude group: 'io.netty' exclude group: 'io.netty.incubator' } - implementation 'org.xerial:sqlite-jdbc:3.42.0.0' - implementation 'com.mysql:mysql-connector-j:8.1.0' + implementation 'org.xerial:sqlite-jdbc:3.46.0.0' + implementation 'com.mysql:mysql-connector-j:9.0.0' } jar { diff --git a/src/main/java/org/geysermc/extension/connect/GeyserConnect.java b/src/main/java/org/geysermc/extension/connect/GeyserConnect.java index c166428..91f2948 100644 --- a/src/main/java/org/geysermc/extension/connect/GeyserConnect.java +++ b/src/main/java/org/geysermc/extension/connect/GeyserConnect.java @@ -134,6 +134,8 @@ public void onSessionInitialize(SessionInitializeEvent event) { public void onCommandDefine(GeyserDefineCommandsEvent event) { event.register(Command.builder(this) .source(GeyserConnection.class) + .playerOnly(true) + .bedrockOnly(true) .name("menu") .description("Take you back to the GeyserConnect menu.") .executor((source, command, args) -> { diff --git a/src/main/java/org/geysermc/extension/connect/PacketHandler.java b/src/main/java/org/geysermc/extension/connect/PacketHandler.java index f1f1fc9..96ed3b2 100644 --- a/src/main/java/org/geysermc/extension/connect/PacketHandler.java +++ b/src/main/java/org/geysermc/extension/connect/PacketHandler.java @@ -39,6 +39,7 @@ import org.geysermc.extension.connect.utils.ServerManager; import org.geysermc.extension.connect.utils.Utils; import org.geysermc.geyser.entity.attribute.GeyserAttributeType; +import org.geysermc.geyser.level.JavaDimension; import org.geysermc.geyser.network.UpstreamPacketHandler; import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.util.DimensionUtils; @@ -55,6 +56,8 @@ public class PacketHandler extends UpstreamPacketHandler { private final GeyserConnect geyserConnect; private final BedrockPacketHandler originalPacketHandler; + private static final JavaDimension END_DIMENSION = new JavaDimension(0, 256, false, 1.0, 2, false); + public PacketHandler(GeyserConnect geyserConnect, GeyserSession session, BedrockPacketHandler packetHandler) { super(session.getGeyser(), session); @@ -63,8 +66,8 @@ public PacketHandler(GeyserConnect geyserConnect, GeyserSession session, Bedrock this.originalPacketHandler = packetHandler; // Spawn the player in the end (it just looks better) - session.setDimension(DimensionUtils.THE_END); - DimensionUtils.setBedrockDimension(session, DimensionUtils.THE_END); + session.setDimensionType(END_DIMENSION); + DimensionUtils.setBedrockDimension(session, END_DIMENSION.bedrockId()); } @Override