Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into feature/configurate
Browse files Browse the repository at this point in the history
# Conflicts:
#	bootstrap/spigot/src/main/java/org/geysermc/geyser/platform/spigot/GeyserSpigotInjector.java
#	bootstrap/standalone/src/main/java/org/geysermc/geyser/platform/standalone/GeyserStandaloneBootstrap.java
#	bootstrap/standalone/src/main/java/org/geysermc/geyser/platform/standalone/GeyserStandaloneLogger.java
#	bootstrap/viaproxy/src/main/java/org/geysermc/geyser/platform/viaproxy/GeyserViaProxyPlugin.java
#	core/src/main/java/org/geysermc/geyser/GeyserImpl.java
#	core/src/main/java/org/geysermc/geyser/network/UpstreamPacketHandler.java
#	core/src/main/java/org/geysermc/geyser/registry/populator/BlockRegistryPopulator.java
#	core/src/main/java/org/geysermc/geyser/registry/populator/CreativeItemRegistryPopulator.java
#	core/src/main/java/org/geysermc/geyser/registry/type/GeyserMappingItem.java
#	core/src/main/java/org/geysermc/geyser/session/GeyserSession.java
#	core/src/main/resources/mappings
  • Loading branch information
onebeastchris committed Feb 27, 2025
2 parents 8b51883 + dd7a0d3 commit 42f135f
Show file tree
Hide file tree
Showing 290 changed files with 43,390 additions and 40,689 deletions.
3 changes: 2 additions & 1 deletion .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
name: Bug report
description: Create a report to help us improve
type: Bug
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to fill out this bug report for Geyser! Fill out the following form to your best ability to help us fix the problem.
Only use this if you're absolutely sure that you found a bug and can reproduce it. For anything else, use: [our Discord server](https://discord.gg/geysermc), [the FAQ](https://github.com/GeyserMC/Geyser/wiki/FAQ) or the [Common Issues](https://github.com/GeyserMC/Geyser/wiki/Common-Issues).
Only use this if you're absolutely sure that you found a bug and can reproduce it. For anything else, use: [our Discord server](https://discord.gg/geysermc), [the FAQ](https://geysermc.org/wiki/geyser/faq) or the [Common Issues](https://geysermc.org/wiki/geyser/common-issues).
- type: textarea
attributes:
label: Describe the bug
Expand Down
5 changes: 3 additions & 2 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
name: Feature request
description: Suggest an idea for this project
labels: "Feature Request"
type: Feature
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to fill out this feature request for Geyser! Please fill out the following form to your best ability to help us understand your feature request and significantly improve the chance of getting added.
For anything else than a feature request, use: [our Discord server](https://discord.gg/geysermc), [the FAQ](https://github.com/GeyserMC/Geyser/wiki/FAQ) or [the Common Issues](https://github.com/GeyserMC/Geyser/wiki/Common-Issues).
For anything else than a feature request, use: [our Discord server](https://discord.gg/geysermc), [the FAQ](https://geysermc.org/wiki/geyser/faq) or the [Common Issues](https://geysermc.org/wiki/geyser/common-issues).
- type: textarea
attributes:
label: What feature do you want to see added?
Expand All @@ -18,4 +19,4 @@ body:
label: Are there any alternatives?
description: List any alternatives you might have tried
validations:
required: true
required: true
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ The ultimate goal of this project is to allow Minecraft: Bedrock Edition users t
Special thanks to the DragonProxy project for being a trailblazer in protocol translation and for all the team members who have joined us here!

## Supported Versions
Geyser is currently supporting Minecraft Bedrock 1.20.80 - 1.21.44 and Minecraft Java 1.21.2/1.21.3. For more information, please see [here](https://geysermc.org/wiki/geyser/supported-versions/).
Geyser is currently supporting Minecraft Bedrock 1.21.40 - 1.21.61 and Minecraft Java 1.21.4. For more information, please see [here](https://geysermc.org/wiki/geyser/supported-versions/).

## Setting Up
Take a look [here](https://geysermc.org/wiki/geyser/setup/) for how to set up Geyser.
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public interface JavaBlockState {
@Nullable String pistonBehavior();

/**
* Gets whether the block state has block entity
* Gets whether the block state has a block entity
*
* @return whether the block state has block entity
* @deprecated Does not have an effect. If you were using this to
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@
public interface GeyserPlayerEntity extends GeyserEntity {

/**
* Gets the position of the player.
* Gets the position of the player, as it is known to the Java server.
*
* @return the position of the player.
* @return the player's position
*/
Vector3f position();
}
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public SessionDisconnectEvent(@NonNull GeyserConnection connection, @NonNull Str
}

/**
* Sets the disconnect reason, thereby overriding th original reason.
* Sets the disconnect message shown to the Bedrock client.
*
* @param disconnectReason the reason for the disconnect
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@
import java.net.InetSocketAddress;

/**
* Called whenever Geyser gets pinged
* Called whenever Geyser gets pinged by a Bedrock client.
* <p>
* This event allows you to modify/obtain the MOTD, maximum player count, and current number of players online,
* Geyser will reply to the client with what was given.
* This event allows you to modify/obtain the MOTD, maximum player count, and current number of players online.
* Geyser will reply to the client with the information provided in this event.
*/
public interface GeyserBedrockPingEvent extends Event {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
* <br>
* This event is mapped to the existence of Brigadier on the server.
*/
public class ServerDefineCommandsEvent extends ConnectionEvent implements Cancellable {
public final class ServerDefineCommandsEvent extends ConnectionEvent implements Cancellable {
private final Set<? extends CommandInfo> commands;
private boolean cancelled;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
* Fired when the Java server sends a transfer request to a different Java server.
* Geyser Extensions can listen to this event and set a target server ip/port for Bedrock players to be transferred to.
*/
public class ServerTransferEvent extends ConnectionEvent {
public final class ServerTransferEvent extends ConnectionEvent {

private final String host;
private final int port;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,9 @@ public interface NonVanillaCustomItemData extends CustomItemData {
@Nullable String toolType();

/**
* Gets the tool tier of the item.
*
* @return the tool tier of the item
* @deprecated no longer used
*/
@Deprecated(forRemoval = true)
@Nullable String toolTier();

/**
Expand All @@ -108,10 +107,9 @@ public interface NonVanillaCustomItemData extends CustomItemData {
@Nullable String translationString();

/**
* Gets the repair materials of the item.
*
* @return the repair materials of the item
* @deprecated No longer used.
*/
@Deprecated(forRemoval = true)
@Nullable Set<String> repairMaterials();

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelOutboundHandlerAdapter;
import io.netty.channel.ChannelPromise;
import net.md_5.bungee.netty.LengthPrependerAndCompressor;
import net.md_5.bungee.protocol.packet.LoginSuccess;
import net.md_5.bungee.protocol.packet.SetCompression;

Expand All @@ -40,8 +41,9 @@ public void write(ChannelHandlerContext ctx, Object msg, ChannelPromise promise)
// Fixes https://github.com/GeyserMC/Geyser/issues/4281
// The server may send a LoginDisconnect packet after compression is set.
if (!compressionDisabled) {
if (ctx.pipeline().get("compress") != null) {
ctx.pipeline().remove("compress");
LengthPrependerAndCompressor compressor = ctx.pipeline().get(LengthPrependerAndCompressor.class);
if (compressor.isCompress()) {
compressor.setCompress(false);
compressionDisabled = true;
}
if (ctx.pipeline().get("decompress") != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,14 @@ protected void initializeLocalChannel0(GeyserBootstrap bootstrap) throws Excepti
throw new UnsupportedOperationException("Geyser does not currently support multiple listeners with injection! " +
"Please reach out to us on our Discord at https://discord.gg/GeyserMC so we can hear feedback on your setup.");
}

// TODO remove
try {
ProxyServer.class.getMethod("unsafe");
} catch (NoSuchMethodException e) {
throw new UnsupportedOperationException("You're using an outdated version of BungeeCord - please update. Thank you!");
}

ListenerInfo listenerInfo = proxy.getConfig().getListeners().stream().findFirst().orElseThrow(IllegalStateException::new);

Class<? extends ProxyServer> proxyClass = proxy.getClass();
Expand Down Expand Up @@ -138,7 +146,7 @@ protected void initChannel(@NonNull Channel ch) throws Exception {
if (channelInitializer == null) {
// Proxy has finished initializing; we can safely grab this variable without fear of plugins modifying it
// (Older versions of ViaVersion replace this to inject)
channelInitializer = PipelineUtils.SERVER_CHILD;
channelInitializer = proxy.unsafe().getFrontendChannelInitializer().getChannelInitializer();
}
initChannel.invoke(channelInitializer, ch);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
package org.geysermc.geyser.platform.bungeecord;

import lombok.AllArgsConstructor;
import net.kyori.adventure.text.serializer.bungeecord.BungeeComponentSerializer;
import net.kyori.adventure.text.serializer.gson.GsonComponentSerializer;
import net.md_5.bungee.api.ProxyServer;
import net.md_5.bungee.api.ServerPing;
import net.md_5.bungee.api.chat.BaseComponent;
Expand Down Expand Up @@ -74,7 +76,7 @@ public GeyserPingInfo getPingInformation(InetSocketAddress inetSocketAddress) {

ServerPing response = event.getResponse();
return new GeyserPingInfo(
response.getDescriptionComponent().toLegacyText(),
GsonComponentSerializer.gson().serialize(BungeeComponentSerializer.get().deserialize(new BaseComponent[]{ response.getDescriptionComponent() })),
response.getPlayers().getMax(),
response.getPlayers().getOnline()
);
Expand Down Expand Up @@ -186,6 +188,21 @@ public boolean isConnected() {
return false;
}

@Override
public boolean isTransferred() {
return false;
}

@Override
public CompletableFuture<byte[]> retrieveCookie(String s) {
throw new UnsupportedOperationException();
}

@Override
public CompletableFuture<byte[]> sendData(String s, byte[] bytes) {
throw new UnsupportedOperationException();
}

@Override
public Unsafe unsafe() {
throw new UnsupportedOperationException();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
import org.geysermc.geyser.configuration.ConfigLoader;
import org.geysermc.geyser.configuration.GeyserPluginConfig;
import org.geysermc.geyser.dump.BootstrapDumpInfo;
import org.geysermc.geyser.network.GameProtocol;
import org.geysermc.geyser.ping.GeyserLegacyPingPassthrough;
import org.geysermc.geyser.ping.IGeyserPingPassthrough;
import org.geysermc.geyser.platform.bungeecord.command.BungeeCommandSource;
Expand All @@ -59,6 +60,7 @@
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Collection;
import java.util.List;
import java.util.Optional;
import java.util.concurrent.TimeUnit;

Expand All @@ -80,18 +82,19 @@ public void onLoad() {
public void onGeyserInitialize() {
GeyserLocale.init(this);

// Copied from ViaVersion.
// https://github.com/ViaVersion/ViaVersion/blob/b8072aad86695cc8ec6f5e4103e43baf3abf6cc5/bungee/src/main/java/us/myles/ViaVersion/BungeePlugin.java#L43
try {
ProtocolConstants.class.getField("MINECRAFT_1_21");
} catch (NoSuchFieldException e) {
geyserLogger.error(" / \\");
geyserLogger.error(" / \\");
geyserLogger.error(" / | \\");
geyserLogger.error(" / | \\ " + GeyserLocale.getLocaleStringLog("geyser.bootstrap.unsupported_proxy", getProxy().getName()));
geyserLogger.error(" / \\ " + GeyserLocale.getLocaleStringLog("geyser.may_not_work_as_intended_all_caps"));
geyserLogger.error(" / o \\");
geyserLogger.error("/_____________\\");
List<Integer> supportedProtocols = ProtocolConstants.SUPPORTED_VERSION_IDS;
if (!supportedProtocols.contains(GameProtocol.getJavaProtocolVersion())) {
geyserLogger.error(" / \\");
geyserLogger.error(" / \\");
geyserLogger.error(" / | \\");
geyserLogger.error(" / | \\ " + GeyserLocale.getLocaleStringLog("geyser.bootstrap.unsupported_proxy", getProxy().getName()));
geyserLogger.error(" / \\ " + GeyserLocale.getLocaleStringLog("geyser.may_not_work_as_intended_all_caps"));
geyserLogger.error(" / o \\");
geyserLogger.error("/_____________\\");
}
} catch (Throwable e) {
geyserLogger.warning("Unable to check the versions supported by this proxy! " + e.getMessage());
}

if (!this.loadConfig()) {
Expand Down
1 change: 1 addition & 0 deletions bootstrap/mod/fabric/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ dependencies {

modImplementation(libs.cloud.fabric)
include(libs.cloud.fabric)
include(libs.fabric.permissions.api)
}

tasks.withType<Jar> {
Expand Down
4 changes: 2 additions & 2 deletions bootstrap/mod/fabric/src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
],
"depends": {
"fabricloader": ">=0.16.7",
"fabric": "*",
"minecraft": ">=1.21.2"
"fabric-api": "*",
"minecraft": ">=1.21.4"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,8 @@ public GeyserPingInfo getPingInformation(InetSocketAddress inetSocketAddress) {
}
}

String jsonDescription = net.minecraft.network.chat.Component.Serializer.toJson(status.description(), RegistryAccess.EMPTY);
String legacyDescription = LEGACY_SERIALIZER.serialize(GSON_SERIALIZER.deserializeOr(jsonDescription, Component.empty()));

return new GeyserPingInfo(
legacyDescription,
net.minecraft.network.chat.Component.Serializer.toJson(status.description(), RegistryAccess.EMPTY),
status.players().map(ServerStatus.Players::max).orElse(1),
status.players().map(ServerStatus.Players::online).orElse(0)
);
Expand Down
Loading

0 comments on commit 42f135f

Please sign in to comment.