Skip to content

Commit 42f135f

Browse files
committed
Merge remote-tracking branch 'upstream/master' into feature/configurate
# 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
2 parents 8b51883 + dd7a0d3 commit 42f135f

File tree

290 files changed

+43390
-40689
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

290 files changed

+43390
-40689
lines changed

.github/ISSUE_TEMPLATE/bug_report.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
name: Bug report
22
description: Create a report to help us improve
3+
type: Bug
34
body:
45
- type: markdown
56
attributes:
67
value: |
78
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.
8-
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).
9+
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).
910
- type: textarea
1011
attributes:
1112
label: Describe the bug

.github/ISSUE_TEMPLATE/feature_request.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
name: Feature request
22
description: Suggest an idea for this project
33
labels: "Feature Request"
4+
type: Feature
45
body:
56
- type: markdown
67
attributes:
78
value: |
89
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.
9-
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).
10+
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).
1011
- type: textarea
1112
attributes:
1213
label: What feature do you want to see added?
@@ -18,4 +19,4 @@ body:
1819
label: Are there any alternatives?
1920
description: List any alternatives you might have tried
2021
validations:
21-
required: true
22+
required: true

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ The ultimate goal of this project is to allow Minecraft: Bedrock Edition users t
1515
Special thanks to the DragonProxy project for being a trailblazer in protocol translation and for all the team members who have joined us here!
1616

1717
## Supported Versions
18-
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/).
18+
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/).
1919

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

api/src/main/java/org/geysermc/geyser/api/block/custom/nonvanilla/JavaBlockItem.java

Lines changed: 0 additions & 7 deletions
This file was deleted.

api/src/main/java/org/geysermc/geyser/api/block/custom/nonvanilla/JavaBlockState.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public interface JavaBlockState {
7070
@Nullable String pistonBehavior();
7171

7272
/**
73-
* Gets whether the block state has block entity
73+
* Gets whether the block state has a block entity
7474
*
7575
* @return whether the block state has block entity
7676
* @deprecated Does not have an effect. If you were using this to

api/src/main/java/org/geysermc/geyser/api/entity/type/player/GeyserPlayerEntity.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@
3131
public interface GeyserPlayerEntity extends GeyserEntity {
3232

3333
/**
34-
* Gets the position of the player.
34+
* Gets the position of the player, as it is known to the Java server.
3535
*
36-
* @return the position of the player.
36+
* @return the player's position
3737
*/
3838
Vector3f position();
3939
}

api/src/main/java/org/geysermc/geyser/api/event/bedrock/SessionDisconnectEvent.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public SessionDisconnectEvent(@NonNull GeyserConnection connection, @NonNull Str
5050
}
5151

5252
/**
53-
* Sets the disconnect reason, thereby overriding th original reason.
53+
* Sets the disconnect message shown to the Bedrock client.
5454
*
5555
* @param disconnectReason the reason for the disconnect
5656
*/

api/src/main/java/org/geysermc/geyser/api/event/connection/GeyserBedrockPingEvent.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@
3333
import java.net.InetSocketAddress;
3434

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

api/src/main/java/org/geysermc/geyser/api/event/java/ServerDefineCommandsEvent.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
* <br>
3838
* This event is mapped to the existence of Brigadier on the server.
3939
*/
40-
public class ServerDefineCommandsEvent extends ConnectionEvent implements Cancellable {
40+
public final class ServerDefineCommandsEvent extends ConnectionEvent implements Cancellable {
4141
private final Set<? extends CommandInfo> commands;
4242
private boolean cancelled;
4343

api/src/main/java/org/geysermc/geyser/api/event/java/ServerTransferEvent.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
* Fired when the Java server sends a transfer request to a different Java server.
3838
* Geyser Extensions can listen to this event and set a target server ip/port for Bedrock players to be transferred to.
3939
*/
40-
public class ServerTransferEvent extends ConnectionEvent {
40+
public final class ServerTransferEvent extends ConnectionEvent {
4141

4242
private final String host;
4343
private final int port;

api/src/main/java/org/geysermc/geyser/api/item/custom/NonVanillaCustomItemData.java

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,9 @@ public interface NonVanillaCustomItemData extends CustomItemData {
8080
@Nullable String toolType();
8181

8282
/**
83-
* Gets the tool tier of the item.
84-
*
85-
* @return the tool tier of the item
83+
* @deprecated no longer used
8684
*/
85+
@Deprecated(forRemoval = true)
8786
@Nullable String toolTier();
8887

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

110109
/**
111-
* Gets the repair materials of the item.
112-
*
113-
* @return the repair materials of the item
110+
* @deprecated No longer used.
114111
*/
112+
@Deprecated(forRemoval = true)
115113
@Nullable Set<String> repairMaterials();
116114

117115
/**

bootstrap/bungeecord/src/main/java/org/geysermc/geyser/platform/bungeecord/GeyserBungeeCompressionDisabler.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
import io.netty.channel.ChannelHandlerContext;
2929
import io.netty.channel.ChannelOutboundHandlerAdapter;
3030
import io.netty.channel.ChannelPromise;
31+
import net.md_5.bungee.netty.LengthPrependerAndCompressor;
3132
import net.md_5.bungee.protocol.packet.LoginSuccess;
3233
import net.md_5.bungee.protocol.packet.SetCompression;
3334

@@ -40,8 +41,9 @@ public void write(ChannelHandlerContext ctx, Object msg, ChannelPromise promise)
4041
// Fixes https://github.com/GeyserMC/Geyser/issues/4281
4142
// The server may send a LoginDisconnect packet after compression is set.
4243
if (!compressionDisabled) {
43-
if (ctx.pipeline().get("compress") != null) {
44-
ctx.pipeline().remove("compress");
44+
LengthPrependerAndCompressor compressor = ctx.pipeline().get(LengthPrependerAndCompressor.class);
45+
if (compressor.isCompress()) {
46+
compressor.setCompress(false);
4547
compressionDisabled = true;
4648
}
4749
if (ctx.pipeline().get("decompress") != null) {

bootstrap/bungeecord/src/main/java/org/geysermc/geyser/platform/bungeecord/GeyserBungeeInjector.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,14 @@ protected void initializeLocalChannel0(GeyserBootstrap bootstrap) throws Excepti
7373
throw new UnsupportedOperationException("Geyser does not currently support multiple listeners with injection! " +
7474
"Please reach out to us on our Discord at https://discord.gg/GeyserMC so we can hear feedback on your setup.");
7575
}
76+
77+
// TODO remove
78+
try {
79+
ProxyServer.class.getMethod("unsafe");
80+
} catch (NoSuchMethodException e) {
81+
throw new UnsupportedOperationException("You're using an outdated version of BungeeCord - please update. Thank you!");
82+
}
83+
7684
ListenerInfo listenerInfo = proxy.getConfig().getListeners().stream().findFirst().orElseThrow(IllegalStateException::new);
7785

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

bootstrap/bungeecord/src/main/java/org/geysermc/geyser/platform/bungeecord/GeyserBungeePingPassthrough.java

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@
2626
package org.geysermc.geyser.platform.bungeecord;
2727

2828
import lombok.AllArgsConstructor;
29+
import net.kyori.adventure.text.serializer.bungeecord.BungeeComponentSerializer;
30+
import net.kyori.adventure.text.serializer.gson.GsonComponentSerializer;
2931
import net.md_5.bungee.api.ProxyServer;
3032
import net.md_5.bungee.api.ServerPing;
3133
import net.md_5.bungee.api.chat.BaseComponent;
@@ -74,7 +76,7 @@ public GeyserPingInfo getPingInformation(InetSocketAddress inetSocketAddress) {
7476

7577
ServerPing response = event.getResponse();
7678
return new GeyserPingInfo(
77-
response.getDescriptionComponent().toLegacyText(),
79+
GsonComponentSerializer.gson().serialize(BungeeComponentSerializer.get().deserialize(new BaseComponent[]{ response.getDescriptionComponent() })),
7880
response.getPlayers().getMax(),
7981
response.getPlayers().getOnline()
8082
);
@@ -186,6 +188,21 @@ public boolean isConnected() {
186188
return false;
187189
}
188190

191+
@Override
192+
public boolean isTransferred() {
193+
return false;
194+
}
195+
196+
@Override
197+
public CompletableFuture<byte[]> retrieveCookie(String s) {
198+
throw new UnsupportedOperationException();
199+
}
200+
201+
@Override
202+
public CompletableFuture<byte[]> sendData(String s, byte[] bytes) {
203+
throw new UnsupportedOperationException();
204+
}
205+
189206
@Override
190207
public Unsafe unsafe() {
191208
throw new UnsupportedOperationException();

bootstrap/bungeecord/src/main/java/org/geysermc/geyser/platform/bungeecord/GeyserBungeePlugin.java

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
import org.geysermc.geyser.configuration.ConfigLoader;
4444
import org.geysermc.geyser.configuration.GeyserPluginConfig;
4545
import org.geysermc.geyser.dump.BootstrapDumpInfo;
46+
import org.geysermc.geyser.network.GameProtocol;
4647
import org.geysermc.geyser.ping.GeyserLegacyPingPassthrough;
4748
import org.geysermc.geyser.ping.IGeyserPingPassthrough;
4849
import org.geysermc.geyser.platform.bungeecord.command.BungeeCommandSource;
@@ -59,6 +60,7 @@
5960
import java.nio.file.Path;
6061
import java.nio.file.Paths;
6162
import java.util.Collection;
63+
import java.util.List;
6264
import java.util.Optional;
6365
import java.util.concurrent.TimeUnit;
6466

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

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

97100
if (!this.loadConfig()) {

bootstrap/mod/fabric/build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ dependencies {
3838

3939
modImplementation(libs.cloud.fabric)
4040
include(libs.cloud.fabric)
41+
include(libs.fabric.permissions.api)
4142
}
4243

4344
tasks.withType<Jar> {

bootstrap/mod/fabric/src/main/resources/fabric.mod.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
],
2525
"depends": {
2626
"fabricloader": ">=0.16.7",
27-
"fabric": "*",
28-
"minecraft": ">=1.21.2"
27+
"fabric-api": "*",
28+
"minecraft": ">=1.21.4"
2929
}
3030
}

bootstrap/mod/src/main/java/org/geysermc/geyser/platform/mod/ModPingPassthrough.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,8 @@ public GeyserPingInfo getPingInformation(InetSocketAddress inetSocketAddress) {
8080
}
8181
}
8282

83-
String jsonDescription = net.minecraft.network.chat.Component.Serializer.toJson(status.description(), RegistryAccess.EMPTY);
84-
String legacyDescription = LEGACY_SERIALIZER.serialize(GSON_SERIALIZER.deserializeOr(jsonDescription, Component.empty()));
85-
8683
return new GeyserPingInfo(
87-
legacyDescription,
84+
net.minecraft.network.chat.Component.Serializer.toJson(status.description(), RegistryAccess.EMPTY),
8885
status.players().map(ServerStatus.Players::max).orElse(1),
8986
status.players().map(ServerStatus.Players::online).orElse(0)
9087
);

0 commit comments

Comments
 (0)