mirror of
https://github.com/GeyserMC/Geyser.git
synced 2025-12-20 15:29:27 +00:00
Update/fix bootstraps and build
This commit is contained in:
@@ -25,6 +25,6 @@
|
|||||||
"depends": {
|
"depends": {
|
||||||
"fabricloader": ">=0.16.7",
|
"fabricloader": ">=0.16.7",
|
||||||
"fabric-api": "*",
|
"fabric-api": "*",
|
||||||
"minecraft": ">=1.21.5"
|
"minecraft": ">=1.21.6"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,6 +32,8 @@ import org.geysermc.geyser.api.event.lifecycle.GeyserRegisterPermissionsEvent;
|
|||||||
import org.geysermc.geyser.api.util.TriState;
|
import org.geysermc.geyser.api.util.TriState;
|
||||||
import org.geysermc.geyser.platform.neoforge.mixin.PermissionNodeMixin;
|
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
|
* 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 FALSE -> false;
|
||||||
case NOT_SET -> {
|
case NOT_SET -> {
|
||||||
if (player != null) {
|
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.
|
yield false; // NeoForge javadocs say player is null in the case of an offline player.
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,12 +16,12 @@ config = "geyser_neoforge.mixins.json"
|
|||||||
[[dependencies.geyser_neoforge]]
|
[[dependencies.geyser_neoforge]]
|
||||||
modId="neoforge"
|
modId="neoforge"
|
||||||
type="required"
|
type="required"
|
||||||
versionRange="[21.5.0-beta,)"
|
versionRange="[21.6.0-beta,)"
|
||||||
ordering="NONE"
|
ordering="NONE"
|
||||||
side="BOTH"
|
side="BOTH"
|
||||||
[[dependencies.geyser_neoforge]]
|
[[dependencies.geyser_neoforge]]
|
||||||
modId="minecraft"
|
modId="minecraft"
|
||||||
type="required"
|
type="required"
|
||||||
versionRange="[1.21.5,)"
|
versionRange="[1.21.6,)"
|
||||||
ordering="NONE"
|
ordering="NONE"
|
||||||
side="BOTH"
|
side="BOTH"
|
||||||
|
|||||||
@@ -25,22 +25,20 @@
|
|||||||
|
|
||||||
package org.geysermc.geyser.platform.mod;
|
package org.geysermc.geyser.platform.mod;
|
||||||
|
|
||||||
|
import com.mojang.serialization.JsonOps;
|
||||||
|
import io.netty.channel.ChannelFutureListener;
|
||||||
import lombok.AllArgsConstructor;
|
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.Connection;
|
||||||
import net.minecraft.network.PacketSendListener;
|
import net.minecraft.network.chat.ComponentSerialization;
|
||||||
import net.minecraft.network.protocol.Packet;
|
import net.minecraft.network.protocol.Packet;
|
||||||
import net.minecraft.network.protocol.PacketFlow;
|
import net.minecraft.network.protocol.PacketFlow;
|
||||||
import net.minecraft.network.protocol.status.ClientboundStatusResponsePacket;
|
import net.minecraft.network.protocol.status.ClientboundStatusResponsePacket;
|
||||||
import net.minecraft.network.protocol.status.ServerStatus;
|
import net.minecraft.network.protocol.status.ServerStatus;
|
||||||
import net.minecraft.network.protocol.status.ServerStatusPacketListener;
|
import net.minecraft.network.protocol.status.ServerStatusPacketListener;
|
||||||
import net.minecraft.network.protocol.status.ServerboundStatusRequestPacket;
|
import net.minecraft.network.protocol.status.ServerboundStatusRequestPacket;
|
||||||
|
import net.minecraft.resources.RegistryOps;
|
||||||
import net.minecraft.server.MinecraftServer;
|
import net.minecraft.server.MinecraftServer;
|
||||||
import net.minecraft.server.network.ServerStatusPacketListenerImpl;
|
import net.minecraft.server.network.ServerStatusPacketListenerImpl;
|
||||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
|
||||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||||
import org.geysermc.geyser.GeyserLogger;
|
import org.geysermc.geyser.GeyserLogger;
|
||||||
import org.geysermc.geyser.ping.GeyserPingInfo;
|
import org.geysermc.geyser.ping.GeyserPingInfo;
|
||||||
@@ -52,9 +50,6 @@ import java.util.Objects;
|
|||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public class ModPingPassthrough implements IGeyserPingPassthrough {
|
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 MinecraftServer server;
|
||||||
private final GeyserLogger logger;
|
private final GeyserLogger logger;
|
||||||
|
|
||||||
@@ -81,7 +76,7 @@ public class ModPingPassthrough implements IGeyserPingPassthrough {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return new GeyserPingInfo(
|
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::max).orElse(1),
|
||||||
status.players().map(ServerStatus.Players::online).orElse(0)
|
status.players().map(ServerStatus.Players::online).orElse(0)
|
||||||
);
|
);
|
||||||
@@ -99,11 +94,11 @@ public class ModPingPassthrough implements IGeyserPingPassthrough {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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) {
|
if (packet instanceof ClientboundStatusResponsePacket statusResponse) {
|
||||||
status = statusResponse.status();
|
status = statusResponse.status();
|
||||||
}
|
}
|
||||||
super.send(packet, packetSendListener, bl);
|
super.send(packet, channelFutureListener, bl);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,10 +25,13 @@
|
|||||||
|
|
||||||
package org.geysermc.geyser.platform.mod.command;
|
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.kyori.adventure.text.serializer.gson.GsonComponentSerializer;
|
||||||
import net.minecraft.commands.CommandSourceStack;
|
import net.minecraft.commands.CommandSourceStack;
|
||||||
import net.minecraft.core.RegistryAccess;
|
|
||||||
import net.minecraft.network.chat.Component;
|
import net.minecraft.network.chat.Component;
|
||||||
|
import net.minecraft.network.chat.ComponentSerialization;
|
||||||
|
import net.minecraft.resources.RegistryOps;
|
||||||
import net.minecraft.server.level.ServerPlayer;
|
import net.minecraft.server.level.ServerPlayer;
|
||||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
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.command.GeyserCommandSource;
|
||||||
import org.geysermc.geyser.text.ChatColor;
|
import org.geysermc.geyser.text.ChatColor;
|
||||||
|
|
||||||
import java.util.Objects;
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
public class ModCommandSource implements GeyserCommandSource {
|
public class ModCommandSource implements GeyserCommandSource {
|
||||||
@@ -65,8 +67,8 @@ public class ModCommandSource implements GeyserCommandSource {
|
|||||||
@Override
|
@Override
|
||||||
public void sendMessage(net.kyori.adventure.text.Component message) {
|
public void sendMessage(net.kyori.adventure.text.Component message) {
|
||||||
if (source.getEntity() instanceof ServerPlayer player) {
|
if (source.getEntity() instanceof ServerPlayer player) {
|
||||||
String decoded = GsonComponentSerializer.gson().serialize(message);
|
JsonElement jsonComponent = GsonComponentSerializer.gson().serializeToTree(message);
|
||||||
player.displayClientMessage(Objects.requireNonNull(Component.Serializer.fromJson(decoded, RegistryAccess.EMPTY)), false);
|
player.displayClientMessage(ComponentSerialization.CODEC.parse(RegistryOps.create(JsonOps.INSTANCE, player.registryAccess()), jsonComponent).getOrThrow(), false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
GeyserCommandSource.super.sendMessage(message);
|
GeyserCommandSource.super.sendMessage(message);
|
||||||
|
|||||||
@@ -25,7 +25,6 @@
|
|||||||
|
|
||||||
package org.geysermc.geyser.platform.mod.world;
|
package org.geysermc.geyser.platform.mod.world;
|
||||||
|
|
||||||
import net.kyori.adventure.text.serializer.gson.GsonComponentSerializer;
|
|
||||||
import net.minecraft.SharedConstants;
|
import net.minecraft.SharedConstants;
|
||||||
import net.minecraft.core.BlockPos;
|
import net.minecraft.core.BlockPos;
|
||||||
import net.minecraft.core.registries.BuiltInRegistries;
|
import net.minecraft.core.registries.BuiltInRegistries;
|
||||||
@@ -50,7 +49,6 @@ import java.util.function.Consumer;
|
|||||||
|
|
||||||
public class GeyserModWorldManager extends GeyserWorldManager {
|
public class GeyserModWorldManager extends GeyserWorldManager {
|
||||||
|
|
||||||
private static final GsonComponentSerializer GSON_SERIALIZER = GsonComponentSerializer.gson();
|
|
||||||
private final MinecraftServer server;
|
private final MinecraftServer server;
|
||||||
|
|
||||||
public GeyserModWorldManager(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
|
// If the protocol version of Geyser and the server are not the
|
||||||
// same, fallback to the chunk cache. May be able to update this
|
// same, fallback to the chunk cache. May be able to update this
|
||||||
// in the future to use ViaVersion however, like Spigot does.
|
// 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);
|
return super.getBlockAt(session, x, y, z);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -96,7 +94,7 @@ public class GeyserModWorldManager extends GeyserWorldManager {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean hasOwnChunkCache() {
|
public boolean hasOwnChunkCache() {
|
||||||
return SharedConstants.getCurrentVersion().getProtocolVersion() == GameProtocol.getJavaProtocolVersion();
|
return SharedConstants.getCurrentVersion().protocolVersion() == GameProtocol.getJavaProtocolVersion();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -26,6 +26,7 @@
|
|||||||
package org.geysermc.geyser.platform.velocity;
|
package org.geysermc.geyser.platform.velocity;
|
||||||
|
|
||||||
import com.velocitypowered.api.event.proxy.ProxyPingEvent;
|
import com.velocitypowered.api.event.proxy.ProxyPingEvent;
|
||||||
|
import com.velocitypowered.api.network.HandshakeIntent;
|
||||||
import com.velocitypowered.api.network.ProtocolState;
|
import com.velocitypowered.api.network.ProtocolState;
|
||||||
import com.velocitypowered.api.network.ProtocolVersion;
|
import com.velocitypowered.api.network.ProtocolVersion;
|
||||||
import com.velocitypowered.api.proxy.InboundConnection;
|
import com.velocitypowered.api.proxy.InboundConnection;
|
||||||
@@ -84,6 +85,11 @@ public class GeyserVelocityPingPassthrough implements IGeyserPingPassthrough {
|
|||||||
return Optional.empty();
|
return Optional.empty();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Optional<String> getRawVirtualHost() {
|
||||||
|
return Optional.empty();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isActive() {
|
public boolean isActive() {
|
||||||
return false;
|
return false;
|
||||||
@@ -98,6 +104,11 @@ public class GeyserVelocityPingPassthrough implements IGeyserPingPassthrough {
|
|||||||
public ProtocolState getProtocolState() {
|
public ProtocolState getProtocolState() {
|
||||||
return ProtocolState.STATUS;
|
return ProtocolState.STATUS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public HandshakeIntent getHandshakeIntent() {
|
||||||
|
return HandshakeIntent.LOGIN;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -109,6 +109,10 @@ public final class GameProtocol {
|
|||||||
return session.protocolVersion() >= Bedrock_v818.CODEC.getProtocolVersion();
|
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.
|
* Gets the {@link PacketCodec} for Minecraft: Java Edition.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -91,9 +91,7 @@ public final class WaypointCache {
|
|||||||
untrack(waypoint);
|
untrack(waypoint);
|
||||||
|
|
||||||
Optional<UUID> uuid = Optional.ofNullable(waypoint.uuid());
|
Optional<UUID> uuid = Optional.ofNullable(waypoint.uuid());
|
||||||
Optional<PlayerEntity> player = session.getEntityCache().getAllPlayerEntities().stream()
|
Optional<PlayerEntity> player = uuid.flatMap(id -> Optional.ofNullable(session.getEntityCache().getPlayerEntity(id)));
|
||||||
.filter(entity -> entity.getUuid().equals(waypoint.uuid()))
|
|
||||||
.findFirst();
|
|
||||||
OptionalLong playerId = player.stream().mapToLong(PlayerEntity::getGeyserId).findFirst();
|
OptionalLong playerId = player.stream().mapToLong(PlayerEntity::getGeyserId).findFirst();
|
||||||
|
|
||||||
GeyserWaypoint tracked = GeyserWaypoint.create(session, uuid, playerId, waypoint);
|
GeyserWaypoint tracked = GeyserWaypoint.create(session, uuid, playerId, waypoint);
|
||||||
|
|||||||
@@ -30,18 +30,18 @@ cloud-minecraft = "2.0.0-beta.9"
|
|||||||
cloud-minecraft-modded = "2.0.0-beta.10"
|
cloud-minecraft-modded = "2.0.0-beta.10"
|
||||||
commodore = "2.2"
|
commodore = "2.2"
|
||||||
bungeecord = "1.21-R0.1-20250215.224541-54"
|
bungeecord = "1.21-R0.1-20250215.224541-54"
|
||||||
velocity = "3.3.0-SNAPSHOT"
|
velocity = "3.4.0-SNAPSHOT"
|
||||||
viaproxy = "3.3.2-SNAPSHOT"
|
viaproxy = "3.3.2-SNAPSHOT"
|
||||||
fabric-loader = "0.16.10"
|
fabric-loader = "0.16.14"
|
||||||
fabric-api = "0.119.5+1.21.5"
|
fabric-api = "0.127.0+1.21.6"
|
||||||
fabric-permissions-api = "0.3.3"
|
fabric-permissions-api = "0.4.0-SNAPSHOT"
|
||||||
neoforge-minecraft = "21.5.0-beta"
|
neoforge-minecraft = "21.6.0-beta"
|
||||||
mixin = "0.8.5"
|
mixin = "0.8.5"
|
||||||
mixinextras = "0.3.5"
|
mixinextras = "0.3.5"
|
||||||
minecraft = "1.21.5"
|
minecraft = "1.21.6"
|
||||||
mockito = "5.+"
|
mockito = "5.+"
|
||||||
runtask = "2.3.1"
|
runtask = "2.3.1"
|
||||||
runpaperversion = "1.21.5"
|
runpaperversion = "1.21.6"
|
||||||
runvelocityversion = "3.4.0-SNAPSHOT"
|
runvelocityversion = "3.4.0-SNAPSHOT"
|
||||||
|
|
||||||
# plugin versions
|
# plugin versions
|
||||||
|
|||||||
Reference in New Issue
Block a user