Merge remote-tracking branch 'upstream/master' into ext-1.19.20-fixes

# Conflicts:
#	ap/pom.xml
#	api/base/pom.xml
#	api/geyser/pom.xml
#	api/pom.xml
#	bootstrap/bungeecord/pom.xml
#	bootstrap/pom.xml
#	bootstrap/spigot/pom.xml
#	bootstrap/sponge/pom.xml
#	bootstrap/standalone/pom.xml
#	bootstrap/velocity/pom.xml
#	common/pom.xml
#	core/pom.xml
#	pom.xml
This commit is contained in:
Konicai 2022-08-10 16:54:46 -04:00
commit 737df21495
No known key found for this signature in database
GPG key ID: 710D09287708C823
7 changed files with 24 additions and 14 deletions

View file

@ -33,7 +33,7 @@ public enum BedrockMapIcon {
ICON_ITEM_FRAME(MapIconType.GREEN_ARROW, 7),
ICON_RED_ARROW(MapIconType.RED_ARROW, 2),
ICON_BLUE_ARROW(MapIconType.BLUE_ARROW, 3),
ICON_TREASURE_MARKER(MapIconType.TREASURE_MARKER, 4),
ICON_WHITE_CROSS(MapIconType.WHITE_CROSS, 4, 0, 0, 0), // Doesn't exist on Bedrock, replaced with a black cross
ICON_RED_POINTER(MapIconType.RED_POINTER, 5),
ICON_WHITE_CIRCLE(MapIconType.WHITE_CIRCLE, 6),
ICON_SMALL_WHITE_CIRCLE(MapIconType.SMALL_WHITE_CIRCLE, 13),
@ -54,7 +54,8 @@ public enum BedrockMapIcon {
ICON_BROWN_BANNER(MapIconType.BROWN_BANNER, 13, 131, 84, 50),
ICON_GREEN_BANNER(MapIconType.GREEN_BANNER, 13, 94, 124, 22),
ICON_RED_BANNER(MapIconType.RED_BANNER, 13, 176, 46, 38),
ICON_BLACK_BANNER(MapIconType.BLACK_BANNER, 13, 29, 29, 33);
ICON_BLACK_BANNER(MapIconType.BLACK_BANNER, 13, 29, 29, 33),
ICON_TREASURE_MARKER(MapIconType.TREASURE_MARKER, 4);
private static final BedrockMapIcon[] VALUES = values();

View file

@ -45,7 +45,7 @@ public final class GameProtocol {
* Default Bedrock codec that should act as a fallback. Should represent the latest available
* release of the game that Geyser supports.
*/
public static final BedrockPacketCodec DEFAULT_BEDROCK_CODEC = Bedrock_v534.V534_CODEC;
public static final BedrockPacketCodec DEFAULT_BEDROCK_CODEC = Bedrock_v544.V544_CODEC;
/**
* A list of all supported Bedrock versions that can join Geyser
*/
@ -61,10 +61,10 @@ public final class GameProtocol {
SUPPORTED_BEDROCK_CODECS.add(Bedrock_v527.V527_CODEC.toBuilder()
.minecraftVersion("1.19.0/1.19.2")
.build());
SUPPORTED_BEDROCK_CODECS.add(DEFAULT_BEDROCK_CODEC.toBuilder()
SUPPORTED_BEDROCK_CODECS.add(Bedrock_v534.V534_CODEC.toBuilder()
.minecraftVersion("1.19.10/1.19.11")
.build());
SUPPORTED_BEDROCK_CODECS.add(Bedrock_v544.V544_CODEC);
SUPPORTED_BEDROCK_CODECS.add(DEFAULT_BEDROCK_CODEC);
}
/**

View file

@ -72,12 +72,19 @@ public class JavaCustomPayloadTranslator extends PacketTranslator<ClientboundCus
String dataString = new String(data, 3, data.length - 3, Charsets.UTF_8);
Form form = Forms.fromJson(dataString, type, (ignored, response) -> {
byte[] raw = response.getBytes(StandardCharsets.UTF_8);
byte[] finalData = new byte[raw.length + 2];
byte[] finalData;
if (response == null) {
// Response data can be null as of 1.19.20 (same behaviour as empty response data)
// Only need to send the form id
finalData = new byte[]{data[1], data[2]};
} else {
byte[] raw = response.getBytes(StandardCharsets.UTF_8);
finalData = new byte[raw.length + 2];
finalData[0] = data[1];
finalData[1] = data[2];
System.arraycopy(raw, 0, finalData, 2, raw.length);
finalData[0] = data[1];
finalData[1] = data[2];
System.arraycopy(raw, 0, finalData, 2, raw.length);
}
session.sendDownstreamPacket(new ServerboundCustomPayloadPacket(channel, finalData));
});

View file

@ -28,6 +28,7 @@ package org.geysermc.geyser.translator.protocol.java.level;
import com.github.steveice10.mc.protocol.data.game.level.map.MapData;
import com.github.steveice10.mc.protocol.data.game.level.map.MapIcon;
import com.github.steveice10.mc.protocol.packet.ingame.clientbound.level.ClientboundMapItemDataPacket;
import com.nukkitx.math.vector.Vector3i;
import com.nukkitx.protocol.bedrock.data.MapDecoration;
import com.nukkitx.protocol.bedrock.data.MapTrackedObject;
import org.geysermc.geyser.level.BedrockMapIcon;
@ -48,6 +49,7 @@ public class JavaMapItemDataTranslator extends PacketTranslator<ClientboundMapIt
mapItemDataPacket.setUniqueMapId(packet.getMapId());
mapItemDataPacket.setDimensionId(DimensionUtils.javaToBedrock(session.getDimension()));
mapItemDataPacket.setLocked(packet.isLocked());
mapItemDataPacket.setOrigin(Vector3i.ZERO); // Required since 1.19.20
mapItemDataPacket.setScale(packet.getScale());
MapData data = packet.getData();