1
0
mirror of https://github.com/GeyserMC/Geyser.git synced 2025-12-19 14:59:27 +00:00

Update/fix bootstraps and build

This commit is contained in:
Eclipse
2025-06-17 18:55:55 +00:00
parent 4502762b67
commit c29b20d23a
10 changed files with 44 additions and 34 deletions

View File

@@ -25,6 +25,6 @@
"depends": {
"fabricloader": ">=0.16.7",
"fabric-api": "*",
"minecraft": ">=1.21.5"
"minecraft": ">=1.21.6"
}
}

View File

@@ -32,6 +32,8 @@ import org.geysermc.geyser.api.event.lifecycle.GeyserRegisterPermissionsEvent;
import org.geysermc.geyser.api.util.TriState;
import org.geysermc.geyser.platform.neoforge.mixin.PermissionNodeMixin;
import java.util.Objects;
/**
* Common logic for handling the more complicated way we have to register permission on NeoForge
*/
@@ -69,7 +71,7 @@ public class PermissionUtils {
case FALSE -> false;
case NOT_SET -> {
if (player != null) {
yield player.createCommandSourceStack().hasPermission(player.server.getOperatorUserPermissionLevel());
yield player.createCommandSourceStack().hasPermission(Objects.requireNonNull(player.getServer()).getOperatorUserPermissionLevel());
}
yield false; // NeoForge javadocs say player is null in the case of an offline player.
}

View File

@@ -16,12 +16,12 @@ config = "geyser_neoforge.mixins.json"
[[dependencies.geyser_neoforge]]
modId="neoforge"
type="required"
versionRange="[21.5.0-beta,)"
versionRange="[21.6.0-beta,)"
ordering="NONE"
side="BOTH"
[[dependencies.geyser_neoforge]]
modId="minecraft"
type="required"
versionRange="[1.21.5,)"
versionRange="[1.21.6,)"
ordering="NONE"
side="BOTH"

View File

@@ -25,22 +25,20 @@
package org.geysermc.geyser.platform.mod;
import com.mojang.serialization.JsonOps;
import io.netty.channel.ChannelFutureListener;
import lombok.AllArgsConstructor;
import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.serializer.gson.GsonComponentSerializer;
import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer;
import net.minecraft.core.RegistryAccess;
import net.minecraft.network.Connection;
import net.minecraft.network.PacketSendListener;
import net.minecraft.network.chat.ComponentSerialization;
import net.minecraft.network.protocol.Packet;
import net.minecraft.network.protocol.PacketFlow;
import net.minecraft.network.protocol.status.ClientboundStatusResponsePacket;
import net.minecraft.network.protocol.status.ServerStatus;
import net.minecraft.network.protocol.status.ServerStatusPacketListener;
import net.minecraft.network.protocol.status.ServerboundStatusRequestPacket;
import net.minecraft.resources.RegistryOps;
import net.minecraft.server.MinecraftServer;
import net.minecraft.server.network.ServerStatusPacketListenerImpl;
import org.checkerframework.checker.nullness.qual.NonNull;
import org.checkerframework.checker.nullness.qual.Nullable;
import org.geysermc.geyser.GeyserLogger;
import org.geysermc.geyser.ping.GeyserPingInfo;
@@ -52,9 +50,6 @@ import java.util.Objects;
@AllArgsConstructor
public class ModPingPassthrough implements IGeyserPingPassthrough {
private static final GsonComponentSerializer GSON_SERIALIZER = GsonComponentSerializer.gson();
private static final LegacyComponentSerializer LEGACY_SERIALIZER = LegacyComponentSerializer.legacySection();
private final MinecraftServer server;
private final GeyserLogger logger;
@@ -81,7 +76,7 @@ public class ModPingPassthrough implements IGeyserPingPassthrough {
}
return new GeyserPingInfo(
net.minecraft.network.chat.Component.Serializer.toJson(status.description(), RegistryAccess.EMPTY),
ComponentSerialization.CODEC.encodeStart(RegistryOps.create(JsonOps.INSTANCE, server.registryAccess()), status.description()).getOrThrow().toString(),
status.players().map(ServerStatus.Players::max).orElse(1),
status.players().map(ServerStatus.Players::online).orElse(0)
);
@@ -99,11 +94,11 @@ public class ModPingPassthrough implements IGeyserPingPassthrough {
}
@Override
public void send(@NonNull Packet<?> packet, @Nullable PacketSendListener packetSendListener, boolean bl) {
public void send(Packet<?> packet, @org.jetbrains.annotations.Nullable ChannelFutureListener channelFutureListener, boolean bl) {
if (packet instanceof ClientboundStatusResponsePacket statusResponse) {
status = statusResponse.status();
}
super.send(packet, packetSendListener, bl);
super.send(packet, channelFutureListener, bl);
}
}
}

View File

@@ -25,10 +25,13 @@
package org.geysermc.geyser.platform.mod.command;
import com.google.gson.JsonElement;
import com.mojang.serialization.JsonOps;
import net.kyori.adventure.text.serializer.gson.GsonComponentSerializer;
import net.minecraft.commands.CommandSourceStack;
import net.minecraft.core.RegistryAccess;
import net.minecraft.network.chat.Component;
import net.minecraft.network.chat.ComponentSerialization;
import net.minecraft.resources.RegistryOps;
import net.minecraft.server.level.ServerPlayer;
import org.checkerframework.checker.nullness.qual.NonNull;
import org.checkerframework.checker.nullness.qual.Nullable;
@@ -36,7 +39,6 @@ import org.geysermc.geyser.GeyserImpl;
import org.geysermc.geyser.command.GeyserCommandSource;
import org.geysermc.geyser.text.ChatColor;
import java.util.Objects;
import java.util.UUID;
public class ModCommandSource implements GeyserCommandSource {
@@ -65,8 +67,8 @@ public class ModCommandSource implements GeyserCommandSource {
@Override
public void sendMessage(net.kyori.adventure.text.Component message) {
if (source.getEntity() instanceof ServerPlayer player) {
String decoded = GsonComponentSerializer.gson().serialize(message);
player.displayClientMessage(Objects.requireNonNull(Component.Serializer.fromJson(decoded, RegistryAccess.EMPTY)), false);
JsonElement jsonComponent = GsonComponentSerializer.gson().serializeToTree(message);
player.displayClientMessage(ComponentSerialization.CODEC.parse(RegistryOps.create(JsonOps.INSTANCE, player.registryAccess()), jsonComponent).getOrThrow(), false);
return;
}
GeyserCommandSource.super.sendMessage(message);

View File

@@ -25,7 +25,6 @@
package org.geysermc.geyser.platform.mod.world;
import net.kyori.adventure.text.serializer.gson.GsonComponentSerializer;
import net.minecraft.SharedConstants;
import net.minecraft.core.BlockPos;
import net.minecraft.core.registries.BuiltInRegistries;
@@ -50,7 +49,6 @@ import java.util.function.Consumer;
public class GeyserModWorldManager extends GeyserWorldManager {
private static final GsonComponentSerializer GSON_SERIALIZER = GsonComponentSerializer.gson();
private final MinecraftServer server;
public GeyserModWorldManager(MinecraftServer server) {
@@ -62,7 +60,7 @@ public class GeyserModWorldManager extends GeyserWorldManager {
// If the protocol version of Geyser and the server are not the
// same, fallback to the chunk cache. May be able to update this
// in the future to use ViaVersion however, like Spigot does.
if (SharedConstants.getCurrentVersion().getProtocolVersion() != GameProtocol.getJavaProtocolVersion()) {
if (SharedConstants.getCurrentVersion().protocolVersion() != GameProtocol.getJavaProtocolVersion()) {
return super.getBlockAt(session, x, y, z);
}
@@ -96,7 +94,7 @@ public class GeyserModWorldManager extends GeyserWorldManager {
@Override
public boolean hasOwnChunkCache() {
return SharedConstants.getCurrentVersion().getProtocolVersion() == GameProtocol.getJavaProtocolVersion();
return SharedConstants.getCurrentVersion().protocolVersion() == GameProtocol.getJavaProtocolVersion();
}
@Override

View File

@@ -26,6 +26,7 @@
package org.geysermc.geyser.platform.velocity;
import com.velocitypowered.api.event.proxy.ProxyPingEvent;
import com.velocitypowered.api.network.HandshakeIntent;
import com.velocitypowered.api.network.ProtocolState;
import com.velocitypowered.api.network.ProtocolVersion;
import com.velocitypowered.api.proxy.InboundConnection;
@@ -84,6 +85,11 @@ public class GeyserVelocityPingPassthrough implements IGeyserPingPassthrough {
return Optional.empty();
}
@Override
public Optional<String> getRawVirtualHost() {
return Optional.empty();
}
@Override
public boolean isActive() {
return false;
@@ -98,6 +104,11 @@ public class GeyserVelocityPingPassthrough implements IGeyserPingPassthrough {
public ProtocolState getProtocolState() {
return ProtocolState.STATUS;
}
@Override
public HandshakeIntent getHandshakeIntent() {
return HandshakeIntent.LOGIN;
}
}
}

View File

@@ -109,6 +109,10 @@ public final class GameProtocol {
return session.protocolVersion() >= Bedrock_v818.CODEC.getProtocolVersion();
}
public static boolean is1_21_80(GeyserSession session) {
return session.protocolVersion() == Bedrock_v800.CODEC.getProtocolVersion();
}
/**
* Gets the {@link PacketCodec} for Minecraft: Java Edition.
*

View File

@@ -91,9 +91,7 @@ public final class WaypointCache {
untrack(waypoint);
Optional<UUID> uuid = Optional.ofNullable(waypoint.uuid());
Optional<PlayerEntity> player = session.getEntityCache().getAllPlayerEntities().stream()
.filter(entity -> entity.getUuid().equals(waypoint.uuid()))
.findFirst();
Optional<PlayerEntity> player = uuid.flatMap(id -> Optional.ofNullable(session.getEntityCache().getPlayerEntity(id)));
OptionalLong playerId = player.stream().mapToLong(PlayerEntity::getGeyserId).findFirst();
GeyserWaypoint tracked = GeyserWaypoint.create(session, uuid, playerId, waypoint);

View File

@@ -30,18 +30,18 @@ cloud-minecraft = "2.0.0-beta.9"
cloud-minecraft-modded = "2.0.0-beta.10"
commodore = "2.2"
bungeecord = "1.21-R0.1-20250215.224541-54"
velocity = "3.3.0-SNAPSHOT"
velocity = "3.4.0-SNAPSHOT"
viaproxy = "3.3.2-SNAPSHOT"
fabric-loader = "0.16.10"
fabric-api = "0.119.5+1.21.5"
fabric-permissions-api = "0.3.3"
neoforge-minecraft = "21.5.0-beta"
fabric-loader = "0.16.14"
fabric-api = "0.127.0+1.21.6"
fabric-permissions-api = "0.4.0-SNAPSHOT"
neoforge-minecraft = "21.6.0-beta"
mixin = "0.8.5"
mixinextras = "0.3.5"
minecraft = "1.21.5"
minecraft = "1.21.6"
mockito = "5.+"
runtask = "2.3.1"
runpaperversion = "1.21.5"
runpaperversion = "1.21.6"
runvelocityversion = "3.4.0-SNAPSHOT"
# plugin versions