Mirror von
https://github.com/GeyserMC/Geyser.git
synchronisiert 2024-12-27 08:30:12 +01:00
Revert "Drop support for versions less than 1.19.80 (#3758)"
This reverts commit 7b05ca3c41
.
Dieser Commit ist enthalten in:
Ursprung
7b05ca3c41
Commit
d93f3dd1f5
@ -28,8 +28,14 @@ package org.geysermc.geyser.network;
|
|||||||
import com.github.steveice10.mc.protocol.codec.MinecraftCodec;
|
import com.github.steveice10.mc.protocol.codec.MinecraftCodec;
|
||||||
import com.github.steveice10.mc.protocol.codec.PacketCodec;
|
import com.github.steveice10.mc.protocol.codec.PacketCodec;
|
||||||
import org.cloudburstmc.protocol.bedrock.codec.BedrockCodec;
|
import org.cloudburstmc.protocol.bedrock.codec.BedrockCodec;
|
||||||
|
import org.cloudburstmc.protocol.bedrock.codec.v557.Bedrock_v557;
|
||||||
|
import org.cloudburstmc.protocol.bedrock.codec.v560.Bedrock_v560;
|
||||||
|
import org.cloudburstmc.protocol.bedrock.codec.v567.Bedrock_v567;
|
||||||
|
import org.cloudburstmc.protocol.bedrock.codec.v568.Bedrock_v568;
|
||||||
|
import org.cloudburstmc.protocol.bedrock.codec.v575.Bedrock_v575;
|
||||||
import org.cloudburstmc.protocol.bedrock.codec.v582.Bedrock_v582;
|
import org.cloudburstmc.protocol.bedrock.codec.v582.Bedrock_v582;
|
||||||
import org.cloudburstmc.protocol.bedrock.netty.codec.packet.BedrockPacketCodec;
|
import org.cloudburstmc.protocol.bedrock.netty.codec.packet.BedrockPacketCodec;
|
||||||
|
import org.geysermc.geyser.session.GeyserSession;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -58,6 +64,17 @@ public final class GameProtocol {
|
|||||||
private static final PacketCodec DEFAULT_JAVA_CODEC = MinecraftCodec.CODEC;
|
private static final PacketCodec DEFAULT_JAVA_CODEC = MinecraftCodec.CODEC;
|
||||||
|
|
||||||
static {
|
static {
|
||||||
|
SUPPORTED_BEDROCK_CODECS.add(Bedrock_v557.CODEC.toBuilder()
|
||||||
|
.minecraftVersion("1.19.40/1.19.41")
|
||||||
|
.build());
|
||||||
|
SUPPORTED_BEDROCK_CODECS.add(Bedrock_v560.CODEC.toBuilder()
|
||||||
|
.minecraftVersion("1.19.50/1.19.51")
|
||||||
|
.build());
|
||||||
|
SUPPORTED_BEDROCK_CODECS.add(Bedrock_v567.CODEC);
|
||||||
|
SUPPORTED_BEDROCK_CODECS.add(Bedrock_v568.CODEC);
|
||||||
|
SUPPORTED_BEDROCK_CODECS.add(Bedrock_v575.CODEC.toBuilder()
|
||||||
|
.minecraftVersion("1.19.70/1.19.71/1.19.73")
|
||||||
|
.build());
|
||||||
SUPPORTED_BEDROCK_CODECS.add(DEFAULT_BEDROCK_CODEC.toBuilder()
|
SUPPORTED_BEDROCK_CODECS.add(DEFAULT_BEDROCK_CODEC.toBuilder()
|
||||||
.minecraftVersion("1.19.80/1.19.81")
|
.minecraftVersion("1.19.80/1.19.81")
|
||||||
.build());
|
.build());
|
||||||
@ -77,6 +94,20 @@ public final class GameProtocol {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Bedrock convenience methods to gatekeep features and easily remove the check on version removal */
|
||||||
|
|
||||||
|
public static boolean supports1_19_50(GeyserSession session) {
|
||||||
|
return session.getUpstream().getProtocolVersion() >= Bedrock_v560.CODEC.getProtocolVersion();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean supports1_19_60(GeyserSession session) {
|
||||||
|
return session.getUpstream().getProtocolVersion() >= Bedrock_v567.CODEC.getProtocolVersion();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean supports1_19_80(GeyserSession session) {
|
||||||
|
return session.getUpstream().getProtocolVersion() >= Bedrock_v582.CODEC.getProtocolVersion();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the {@link PacketCodec} for Minecraft: Java Edition.
|
* Gets the {@link PacketCodec} for Minecraft: Java Edition.
|
||||||
*
|
*
|
||||||
|
@ -28,6 +28,8 @@ package org.geysermc.geyser.network;
|
|||||||
import io.netty.buffer.Unpooled;
|
import io.netty.buffer.Unpooled;
|
||||||
import org.cloudburstmc.protocol.bedrock.BedrockDisconnectReasons;
|
import org.cloudburstmc.protocol.bedrock.BedrockDisconnectReasons;
|
||||||
import org.cloudburstmc.protocol.bedrock.codec.BedrockCodec;
|
import org.cloudburstmc.protocol.bedrock.codec.BedrockCodec;
|
||||||
|
import org.cloudburstmc.protocol.bedrock.codec.v567.Bedrock_v567;
|
||||||
|
import org.cloudburstmc.protocol.bedrock.codec.v568.Bedrock_v568;
|
||||||
import org.cloudburstmc.protocol.bedrock.data.ExperimentData;
|
import org.cloudburstmc.protocol.bedrock.data.ExperimentData;
|
||||||
import org.cloudburstmc.protocol.bedrock.data.PacketCompressionAlgorithm;
|
import org.cloudburstmc.protocol.bedrock.data.PacketCompressionAlgorithm;
|
||||||
import org.cloudburstmc.protocol.bedrock.data.ResourcePackType;
|
import org.cloudburstmc.protocol.bedrock.data.ResourcePackType;
|
||||||
@ -171,6 +173,11 @@ public class UpstreamPacketHandler extends LoggingPacketHandler {
|
|||||||
return PacketSignal.HANDLED;
|
return PacketSignal.HANDLED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Hack for... whatever this is
|
||||||
|
if (loginPacket.getProtocolVersion() == Bedrock_v567.CODEC.getProtocolVersion() && !session.getClientData().getGameVersion().equals("1.19.60")) {
|
||||||
|
session.getUpstream().getSession().setCodec(Bedrock_v568.CODEC);
|
||||||
|
}
|
||||||
|
|
||||||
PlayStatusPacket playStatus = new PlayStatusPacket();
|
PlayStatusPacket playStatus = new PlayStatusPacket();
|
||||||
playStatus.setStatus(PlayStatusPacket.Status.LOGIN_SUCCESS);
|
playStatus.setStatus(PlayStatusPacket.Status.LOGIN_SUCCESS);
|
||||||
session.sendUpstreamPacket(playStatus);
|
session.sendUpstreamPacket(playStatus);
|
||||||
|
@ -32,6 +32,10 @@ import com.google.common.collect.Interner;
|
|||||||
import com.google.common.collect.Interners;
|
import com.google.common.collect.Interners;
|
||||||
import it.unimi.dsi.fastutil.objects.*;
|
import it.unimi.dsi.fastutil.objects.*;
|
||||||
import org.cloudburstmc.nbt.*;
|
import org.cloudburstmc.nbt.*;
|
||||||
|
import org.cloudburstmc.protocol.bedrock.codec.v544.Bedrock_v544;
|
||||||
|
import org.cloudburstmc.protocol.bedrock.codec.v560.Bedrock_v560;
|
||||||
|
import org.cloudburstmc.protocol.bedrock.codec.v567.Bedrock_v567;
|
||||||
|
import org.cloudburstmc.protocol.bedrock.codec.v575.Bedrock_v575;
|
||||||
import org.cloudburstmc.protocol.bedrock.codec.v582.Bedrock_v582;
|
import org.cloudburstmc.protocol.bedrock.codec.v582.Bedrock_v582;
|
||||||
import org.cloudburstmc.protocol.bedrock.data.defintions.BlockDefinition;
|
import org.cloudburstmc.protocol.bedrock.data.defintions.BlockDefinition;
|
||||||
import org.geysermc.geyser.GeyserImpl;
|
import org.geysermc.geyser.GeyserImpl;
|
||||||
@ -78,6 +82,10 @@ public final class BlockRegistryPopulator {
|
|||||||
};
|
};
|
||||||
BiFunction<String, NbtMapBuilder, String> emptyMapper = (bedrockIdentifier, statesBuilder) -> null;
|
BiFunction<String, NbtMapBuilder, String> emptyMapper = (bedrockIdentifier, statesBuilder) -> null;
|
||||||
ImmutableMap<ObjectIntPair<String>, BiFunction<String, NbtMapBuilder, String>> blockMappers = ImmutableMap.<ObjectIntPair<String>, BiFunction<String, NbtMapBuilder, String>>builder()
|
ImmutableMap<ObjectIntPair<String>, BiFunction<String, NbtMapBuilder, String>> blockMappers = ImmutableMap.<ObjectIntPair<String>, BiFunction<String, NbtMapBuilder, String>>builder()
|
||||||
|
.put(ObjectIntPair.of("1_19_20", Bedrock_v544.CODEC.getProtocolVersion()), emptyMapper)
|
||||||
|
.put(ObjectIntPair.of("1_19_50", Bedrock_v560.CODEC.getProtocolVersion()), emptyMapper)
|
||||||
|
.put(ObjectIntPair.of("1_19_60", Bedrock_v567.CODEC.getProtocolVersion()), emptyMapper)
|
||||||
|
.put(ObjectIntPair.of("1_19_70", Bedrock_v575.CODEC.getProtocolVersion()), woolMapper)
|
||||||
.put(ObjectIntPair.of("1_19_80", Bedrock_v582.CODEC.getProtocolVersion()), (bedrockIdentifier, statesBuilder) -> {
|
.put(ObjectIntPair.of("1_19_80", Bedrock_v582.CODEC.getProtocolVersion()), (bedrockIdentifier, statesBuilder) -> {
|
||||||
String identifier = woolMapper.apply(bedrockIdentifier, statesBuilder);
|
String identifier = woolMapper.apply(bedrockIdentifier, statesBuilder);
|
||||||
if (identifier != null) {
|
if (identifier != null) {
|
||||||
|
@ -37,6 +37,10 @@ import it.unimi.dsi.fastutil.objects.*;
|
|||||||
import org.cloudburstmc.nbt.NbtMap;
|
import org.cloudburstmc.nbt.NbtMap;
|
||||||
import org.cloudburstmc.nbt.NbtMapBuilder;
|
import org.cloudburstmc.nbt.NbtMapBuilder;
|
||||||
import org.cloudburstmc.nbt.NbtType;
|
import org.cloudburstmc.nbt.NbtType;
|
||||||
|
import org.cloudburstmc.protocol.bedrock.codec.v544.Bedrock_v544;
|
||||||
|
import org.cloudburstmc.protocol.bedrock.codec.v560.Bedrock_v560;
|
||||||
|
import org.cloudburstmc.protocol.bedrock.codec.v567.Bedrock_v567;
|
||||||
|
import org.cloudburstmc.protocol.bedrock.codec.v575.Bedrock_v575;
|
||||||
import org.cloudburstmc.protocol.bedrock.codec.v582.Bedrock_v582;
|
import org.cloudburstmc.protocol.bedrock.codec.v582.Bedrock_v582;
|
||||||
import org.cloudburstmc.protocol.bedrock.data.defintions.BlockDefinition;
|
import org.cloudburstmc.protocol.bedrock.data.defintions.BlockDefinition;
|
||||||
import org.cloudburstmc.protocol.bedrock.data.defintions.ItemDefinition;
|
import org.cloudburstmc.protocol.bedrock.data.defintions.ItemDefinition;
|
||||||
@ -70,7 +74,17 @@ public class ItemRegistryPopulator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void populate() {
|
public static void populate() {
|
||||||
|
Map<Item, String> manualFallback = new HashMap<>();
|
||||||
|
manualFallback.put(Items.ENDER_DRAGON_SPAWN_EGG, "minecraft:enderman_spawn_egg");
|
||||||
|
manualFallback.put(Items.WITHER_SPAWN_EGG, "minecraft:wither_skeleton_spawn_egg");
|
||||||
|
manualFallback.put(Items.SNOW_GOLEM_SPAWN_EGG, "minecraft:polar_bear_spawn_egg");
|
||||||
|
manualFallback.put(Items.IRON_GOLEM_SPAWN_EGG, "minecraft:villager_spawn_egg");
|
||||||
|
|
||||||
Map<String, PaletteVersion> paletteVersions = new Object2ObjectOpenHashMap<>();
|
Map<String, PaletteVersion> paletteVersions = new Object2ObjectOpenHashMap<>();
|
||||||
|
paletteVersions.put("1_19_20", new PaletteVersion(Bedrock_v544.CODEC.getProtocolVersion(), manualFallback));
|
||||||
|
paletteVersions.put("1_19_50", new PaletteVersion(Bedrock_v560.CODEC.getProtocolVersion(), manualFallback));
|
||||||
|
paletteVersions.put("1_19_60", new PaletteVersion(Bedrock_v567.CODEC.getProtocolVersion(), Collections.emptyMap()));
|
||||||
|
paletteVersions.put("1_19_70", new PaletteVersion(Bedrock_v575.CODEC.getProtocolVersion(), Collections.emptyMap()));
|
||||||
paletteVersions.put("1_19_80", new PaletteVersion(Bedrock_v582.CODEC.getProtocolVersion(), Collections.emptyMap()));
|
paletteVersions.put("1_19_80", new PaletteVersion(Bedrock_v582.CODEC.getProtocolVersion(), Collections.emptyMap()));
|
||||||
|
|
||||||
GeyserBootstrap bootstrap = GeyserImpl.getInstance().getBootstrap();
|
GeyserBootstrap bootstrap = GeyserImpl.getInstance().getBootstrap();
|
||||||
@ -168,6 +182,11 @@ public class ItemRegistryPopulator {
|
|||||||
Set<Item> javaOnlyItems = new ObjectOpenHashSet<>();
|
Set<Item> javaOnlyItems = new ObjectOpenHashSet<>();
|
||||||
Collections.addAll(javaOnlyItems, Items.SPECTRAL_ARROW, Items.DEBUG_STICK,
|
Collections.addAll(javaOnlyItems, Items.SPECTRAL_ARROW, Items.DEBUG_STICK,
|
||||||
Items.KNOWLEDGE_BOOK, Items.TIPPED_ARROW, Items.BUNDLE);
|
Items.KNOWLEDGE_BOOK, Items.TIPPED_ARROW, Items.BUNDLE);
|
||||||
|
// these spawn eggs exist in 1.19.60+;
|
||||||
|
if (palette.getValue().protocolVersion() < Bedrock_v567.CODEC.getProtocolVersion()) {
|
||||||
|
Collections.addAll(javaOnlyItems, Items.IRON_GOLEM_SPAWN_EGG, Items.SNOW_GOLEM_SPAWN_EGG,
|
||||||
|
Items.WITHER_SPAWN_EGG, Items.ENDER_DRAGON_SPAWN_EGG);
|
||||||
|
}
|
||||||
javaOnlyItems.add(Items.DECORATED_POT);
|
javaOnlyItems.add(Items.DECORATED_POT);
|
||||||
if (!customItemsAllowed) {
|
if (!customItemsAllowed) {
|
||||||
javaOnlyItems.add(Items.FURNACE_MINECART);
|
javaOnlyItems.add(Items.FURNACE_MINECART);
|
||||||
@ -199,18 +218,21 @@ public class ItemRegistryPopulator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
String bedrockIdentifier;
|
String bedrockIdentifier;
|
||||||
if (mappingItem.getBedrockIdentifier().equals("minecraft:wool")) {
|
// 1.19.70+
|
||||||
|
if (palette.getValue().protocolVersion() >= Bedrock_v575.CODEC.getProtocolVersion() && mappingItem.getBedrockIdentifier().equals("minecraft:wool")) {
|
||||||
bedrockIdentifier = javaItem.javaIdentifier();
|
bedrockIdentifier = javaItem.javaIdentifier();
|
||||||
} else {
|
} else {
|
||||||
bedrockIdentifier = mappingItem.getBedrockIdentifier();
|
bedrockIdentifier = mappingItem.getBedrockIdentifier();
|
||||||
}
|
}
|
||||||
|
|
||||||
//1.19.80+
|
//1.19.80+
|
||||||
|
if (palette.getValue().protocolVersion >= Bedrock_v582.CODEC.getProtocolVersion()) {
|
||||||
if (mappingItem.getBedrockIdentifier().equals("minecraft:log") ||
|
if (mappingItem.getBedrockIdentifier().equals("minecraft:log") ||
|
||||||
mappingItem.getBedrockIdentifier().equals("minecraft:log2") ||
|
mappingItem.getBedrockIdentifier().equals("minecraft:log2") ||
|
||||||
mappingItem.getBedrockIdentifier().equals("minecraft:fence")) {
|
mappingItem.getBedrockIdentifier().equals("minecraft:fence")) {
|
||||||
bedrockIdentifier = javaItem.javaIdentifier();
|
bedrockIdentifier = javaItem.javaIdentifier();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ItemDefinition definition = definitions.get(bedrockIdentifier);
|
ItemDefinition definition = definitions.get(bedrockIdentifier);
|
||||||
if (definition == null) {
|
if (definition == null) {
|
||||||
|
@ -42,6 +42,7 @@ import org.geysermc.geyser.level.physics.Axis;
|
|||||||
import org.geysermc.geyser.level.physics.BoundingBox;
|
import org.geysermc.geyser.level.physics.BoundingBox;
|
||||||
import org.geysermc.geyser.level.physics.CollisionManager;
|
import org.geysermc.geyser.level.physics.CollisionManager;
|
||||||
import org.geysermc.geyser.level.physics.Direction;
|
import org.geysermc.geyser.level.physics.Direction;
|
||||||
|
import org.geysermc.geyser.network.GameProtocol;
|
||||||
import org.geysermc.geyser.registry.Registries;
|
import org.geysermc.geyser.registry.Registries;
|
||||||
import org.geysermc.geyser.session.GeyserSession;
|
import org.geysermc.geyser.session.GeyserSession;
|
||||||
import org.geysermc.geyser.session.cache.PistonCache;
|
import org.geysermc.geyser.session.cache.PistonCache;
|
||||||
@ -621,6 +622,10 @@ public class PistonBlockEntity {
|
|||||||
Vector3i movement = getMovement();
|
Vector3i movement = getMovement();
|
||||||
attachedBlocks.forEach((blockPos, javaId) -> {
|
attachedBlocks.forEach((blockPos, javaId) -> {
|
||||||
blockPos = blockPos.add(movement);
|
blockPos = blockPos.add(movement);
|
||||||
|
if (!GameProtocol.supports1_19_50(session)) {
|
||||||
|
// Send a final block entity packet to detach blocks for clients older than 1.19.50
|
||||||
|
BlockEntityUtils.updateBlockEntity(session, buildMovingBlockTag(blockPos, javaId, Direction.DOWN.getUnitVector()), blockPos);
|
||||||
|
}
|
||||||
// Don't place blocks that collide with the player
|
// Don't place blocks that collide with the player
|
||||||
if (!SOLID_BOUNDING_BOX.checkIntersection(blockPos.toDouble(), session.getCollisionManager().getPlayerBoundingBox())) {
|
if (!SOLID_BOUNDING_BOX.checkIntersection(blockPos.toDouble(), session.getCollisionManager().getPlayerBoundingBox())) {
|
||||||
ChunkUtils.updateBlock(session, javaId, blockPos);
|
ChunkUtils.updateBlock(session, javaId, blockPos);
|
||||||
|
@ -30,6 +30,7 @@ import com.github.steveice10.mc.protocol.packet.ingame.serverbound.level.Serverb
|
|||||||
import org.cloudburstmc.math.vector.Vector3i;
|
import org.cloudburstmc.math.vector.Vector3i;
|
||||||
import org.cloudburstmc.nbt.NbtMap;
|
import org.cloudburstmc.nbt.NbtMap;
|
||||||
import org.cloudburstmc.protocol.bedrock.packet.BlockEntityDataPacket;
|
import org.cloudburstmc.protocol.bedrock.packet.BlockEntityDataPacket;
|
||||||
|
import org.geysermc.geyser.network.GameProtocol;
|
||||||
import org.geysermc.geyser.session.GeyserSession;
|
import org.geysermc.geyser.session.GeyserSession;
|
||||||
import org.geysermc.geyser.translator.protocol.PacketTranslator;
|
import org.geysermc.geyser.translator.protocol.PacketTranslator;
|
||||||
import org.geysermc.geyser.translator.protocol.Translator;
|
import org.geysermc.geyser.translator.protocol.Translator;
|
||||||
@ -44,9 +45,15 @@ public class BedrockBlockEntityDataTranslator extends PacketTranslator<BlockEnti
|
|||||||
NbtMap tag = packet.getData();
|
NbtMap tag = packet.getData();
|
||||||
String id = tag.getString("id");
|
String id = tag.getString("id");
|
||||||
if (id.equals("Sign")) {
|
if (id.equals("Sign")) {
|
||||||
|
String text;
|
||||||
|
if (GameProtocol.supports1_19_80(session)) {
|
||||||
// The other side is called... you guessed it... BackText
|
// The other side is called... you guessed it... BackText
|
||||||
String text = MessageTranslator.convertToPlainText(
|
text = tag.getCompound("FrontText")
|
||||||
tag.getCompound("FrontText").getString("Text"));
|
.getString("Text");
|
||||||
|
} else {
|
||||||
|
text = tag.getString("Text");
|
||||||
|
}
|
||||||
|
text = MessageTranslator.convertToPlainText(text);
|
||||||
// Note: as of 1.18.30, only one packet is sent from Bedrock when the sign is finished.
|
// Note: as of 1.18.30, only one packet is sent from Bedrock when the sign is finished.
|
||||||
// Previous versions did not have this behavior.
|
// Previous versions did not have this behavior.
|
||||||
StringBuilder newMessage = new StringBuilder();
|
StringBuilder newMessage = new StringBuilder();
|
||||||
|
@ -49,6 +49,7 @@ import org.geysermc.geyser.inventory.recipe.GeyserRecipe;
|
|||||||
import org.geysermc.geyser.inventory.recipe.GeyserShapedRecipe;
|
import org.geysermc.geyser.inventory.recipe.GeyserShapedRecipe;
|
||||||
import org.geysermc.geyser.inventory.recipe.GeyserShapelessRecipe;
|
import org.geysermc.geyser.inventory.recipe.GeyserShapelessRecipe;
|
||||||
import org.geysermc.geyser.inventory.recipe.GeyserStonecutterData;
|
import org.geysermc.geyser.inventory.recipe.GeyserStonecutterData;
|
||||||
|
import org.geysermc.geyser.network.GameProtocol;
|
||||||
import org.geysermc.geyser.registry.Registries;
|
import org.geysermc.geyser.registry.Registries;
|
||||||
import org.geysermc.geyser.registry.type.ItemMapping;
|
import org.geysermc.geyser.registry.type.ItemMapping;
|
||||||
import org.geysermc.geyser.session.GeyserSession;
|
import org.geysermc.geyser.session.GeyserSession;
|
||||||
@ -154,9 +155,16 @@ public class JavaUpdateRecipesTranslator extends PacketTranslator<ClientboundUpd
|
|||||||
for (ItemStack addition : recipeData.getAddition().getOptions()) {
|
for (ItemStack addition : recipeData.getAddition().getOptions()) {
|
||||||
ItemDescriptorWithCount bedrockAddition = ItemDescriptorWithCount.fromItem(ItemTranslator.translateToBedrock(session, addition));
|
ItemDescriptorWithCount bedrockAddition = ItemDescriptorWithCount.fromItem(ItemTranslator.translateToBedrock(session, addition));
|
||||||
|
|
||||||
|
if (GameProtocol.supports1_19_60(session)) {
|
||||||
// Note: vanilla inputs use aux value of Short.MAX_VALUE
|
// Note: vanilla inputs use aux value of Short.MAX_VALUE
|
||||||
craftingDataPacket.getCraftingData().add(SmithingTransformRecipeData.of(recipe.getIdentifier(),
|
craftingDataPacket.getCraftingData().add(SmithingTransformRecipeData.of(recipe.getIdentifier(),
|
||||||
ItemDescriptorWithCount.EMPTY, bedrockBase, bedrockAddition, output, "smithing_table", netId++));
|
ItemDescriptorWithCount.EMPTY, bedrockBase, bedrockAddition, output, "smithing_table", netId++));
|
||||||
|
} else {
|
||||||
|
UUID uuid = UUID.randomUUID();
|
||||||
|
craftingDataPacket.getCraftingData().add(org.cloudburstmc.protocol.bedrock.data.inventory.crafting.recipe.ShapelessRecipeData.shapeless(uuid.toString(),
|
||||||
|
List.of(bedrockBase, bedrockAddition),
|
||||||
|
Collections.singletonList(output), uuid, "smithing_table", 2, netId++));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -27,6 +27,7 @@ package org.geysermc.geyser.translator.protocol.java.level;
|
|||||||
|
|
||||||
import com.github.steveice10.mc.protocol.packet.ingame.clientbound.level.ClientboundOpenSignEditorPacket;
|
import com.github.steveice10.mc.protocol.packet.ingame.clientbound.level.ClientboundOpenSignEditorPacket;
|
||||||
import org.cloudburstmc.protocol.bedrock.packet.OpenSignPacket;
|
import org.cloudburstmc.protocol.bedrock.packet.OpenSignPacket;
|
||||||
|
import org.geysermc.geyser.network.GameProtocol;
|
||||||
import org.geysermc.geyser.session.GeyserSession;
|
import org.geysermc.geyser.session.GeyserSession;
|
||||||
import org.geysermc.geyser.translator.protocol.PacketTranslator;
|
import org.geysermc.geyser.translator.protocol.PacketTranslator;
|
||||||
import org.geysermc.geyser.translator.protocol.Translator;
|
import org.geysermc.geyser.translator.protocol.Translator;
|
||||||
@ -36,9 +37,11 @@ public class JavaOpenSignEditorTranslator extends PacketTranslator<ClientboundOp
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void translate(GeyserSession session, ClientboundOpenSignEditorPacket packet) {
|
public void translate(GeyserSession session, ClientboundOpenSignEditorPacket packet) {
|
||||||
|
if (GameProtocol.supports1_19_80(session)) {
|
||||||
OpenSignPacket openSignPacket = new OpenSignPacket();
|
OpenSignPacket openSignPacket = new OpenSignPacket();
|
||||||
openSignPacket.setPosition(packet.getPosition());
|
openSignPacket.setPosition(packet.getPosition());
|
||||||
openSignPacket.setFrontSide(true); // Will be remedied in 1.20
|
openSignPacket.setFrontSide(true); // Will be remedied in 1.20
|
||||||
session.sendUpstreamPacket(openSignPacket);
|
session.sendUpstreamPacket(openSignPacket);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
@ -36,6 +36,7 @@ import org.cloudburstmc.protocol.bedrock.packet.PlayerActionPacket;
|
|||||||
import org.cloudburstmc.protocol.bedrock.packet.StopSoundPacket;
|
import org.cloudburstmc.protocol.bedrock.packet.StopSoundPacket;
|
||||||
import org.geysermc.geyser.entity.type.Entity;
|
import org.geysermc.geyser.entity.type.Entity;
|
||||||
import org.geysermc.geyser.level.BedrockDimension;
|
import org.geysermc.geyser.level.BedrockDimension;
|
||||||
|
import org.geysermc.geyser.network.GameProtocol;
|
||||||
import org.geysermc.geyser.session.GeyserSession;
|
import org.geysermc.geyser.session.GeyserSession;
|
||||||
|
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
@ -121,8 +122,9 @@ public class DimensionUtils {
|
|||||||
stopSoundPacket.setSoundName("");
|
stopSoundPacket.setSoundName("");
|
||||||
session.sendUpstreamPacket(stopSoundPacket);
|
session.sendUpstreamPacket(stopSoundPacket);
|
||||||
|
|
||||||
// Kind of silly but Bedrock 1.19.50 and later requires an acknowledgement after the
|
// Kind of silly but Bedrock 1.19.50 requires an acknowledgement after the
|
||||||
// initial chunks are sent, prior to the client acknowledgement
|
// initial chunks are sent, prior to the client acknowledgement
|
||||||
|
if (GameProtocol.supports1_19_50(session)) {
|
||||||
// Note: send this before chunks are sent. Fixed https://github.com/GeyserMC/Geyser/issues/3421
|
// Note: send this before chunks are sent. Fixed https://github.com/GeyserMC/Geyser/issues/3421
|
||||||
PlayerActionPacket ackPacket = new PlayerActionPacket();
|
PlayerActionPacket ackPacket = new PlayerActionPacket();
|
||||||
ackPacket.setRuntimeEntityId(player.getGeyserId());
|
ackPacket.setRuntimeEntityId(player.getGeyserId());
|
||||||
@ -131,6 +133,7 @@ public class DimensionUtils {
|
|||||||
ackPacket.setResultPosition(Vector3i.ZERO);
|
ackPacket.setResultPosition(Vector3i.ZERO);
|
||||||
ackPacket.setFace(0);
|
ackPacket.setFace(0);
|
||||||
session.sendUpstreamPacket(ackPacket);
|
session.sendUpstreamPacket(ackPacket);
|
||||||
|
}
|
||||||
|
|
||||||
// TODO - fix this hack of a fix by sending the final dimension switching logic after sections have been sent.
|
// TODO - fix this hack of a fix by sending the final dimension switching logic after sections have been sent.
|
||||||
// The client wants sections sent to it before it can successfully respawn.
|
// The client wants sections sent to it before it can successfully respawn.
|
||||||
|
BIN
core/src/main/resources/bedrock/block_palette.1_19_20.nbt
Normale Datei
BIN
core/src/main/resources/bedrock/block_palette.1_19_20.nbt
Normale Datei
Binäre Datei nicht angezeigt.
BIN
core/src/main/resources/bedrock/block_palette.1_19_50.nbt
Normale Datei
BIN
core/src/main/resources/bedrock/block_palette.1_19_50.nbt
Normale Datei
Binäre Datei nicht angezeigt.
BIN
core/src/main/resources/bedrock/block_palette.1_19_60.nbt
Normale Datei
BIN
core/src/main/resources/bedrock/block_palette.1_19_60.nbt
Normale Datei
Binäre Datei nicht angezeigt.
BIN
core/src/main/resources/bedrock/block_palette.1_19_70.nbt
Normale Datei
BIN
core/src/main/resources/bedrock/block_palette.1_19_70.nbt
Normale Datei
Binäre Datei nicht angezeigt.
5440
core/src/main/resources/bedrock/creative_items.1_19_20.json
Normale Datei
5440
core/src/main/resources/bedrock/creative_items.1_19_20.json
Normale Datei
Datei-Diff unterdrückt, da er zu groß ist
Diff laden
5533
core/src/main/resources/bedrock/creative_items.1_19_50.json
Normale Datei
5533
core/src/main/resources/bedrock/creative_items.1_19_50.json
Normale Datei
Datei-Diff unterdrückt, da er zu groß ist
Diff laden
5452
core/src/main/resources/bedrock/creative_items.1_19_60.json
Normale Datei
5452
core/src/main/resources/bedrock/creative_items.1_19_60.json
Normale Datei
Datei-Diff unterdrückt, da er zu groß ist
Diff laden
5452
core/src/main/resources/bedrock/creative_items.1_19_70.json
Normale Datei
5452
core/src/main/resources/bedrock/creative_items.1_19_70.json
Normale Datei
Datei-Diff unterdrückt, da er zu groß ist
Diff laden
4530
core/src/main/resources/bedrock/runtime_item_states.1_19_20.json
Normale Datei
4530
core/src/main/resources/bedrock/runtime_item_states.1_19_20.json
Normale Datei
Datei-Diff unterdrückt, da er zu groß ist
Diff laden
4654
core/src/main/resources/bedrock/runtime_item_states.1_19_50.json
Normale Datei
4654
core/src/main/resources/bedrock/runtime_item_states.1_19_50.json
Normale Datei
Datei-Diff unterdrückt, da er zu groß ist
Diff laden
4682
core/src/main/resources/bedrock/runtime_item_states.1_19_60.json
Normale Datei
4682
core/src/main/resources/bedrock/runtime_item_states.1_19_60.json
Normale Datei
Datei-Diff unterdrückt, da er zu groß ist
Diff laden
4786
core/src/main/resources/bedrock/runtime_item_states.1_19_70.json
Normale Datei
4786
core/src/main/resources/bedrock/runtime_item_states.1_19_70.json
Normale Datei
Datei-Diff unterdrückt, da er zu groß ist
Diff laden
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren