Skip to content

Commit

Permalink
Update Geyser API to 2.4.1
Browse files Browse the repository at this point in the history
  • Loading branch information
rtm516 committed Aug 1, 2024
1 parent 24e9ee6 commit 9374f91
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
8 changes: 4 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);

Expand All @@ -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
Expand Down

0 comments on commit 9374f91

Please sign in to comment.