mirror of
https://github.com/GeyserMC/Geyser.git
synced 2024-08-14 23:57:35 +00:00
Drop support for 1.19.80 (#4091)
* Initial removal of any 1.19.80 logic * Re-add isPre1_20_1 method
This commit is contained in:
parent
ec5a20113d
commit
d4ae428225
10 changed files with 2 additions and 11332 deletions
|
@ -14,7 +14,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!
|
||||
|
||||
### Currently supporting Minecraft Bedrock 1.19.80 - 1.20.10 and Minecraft Java 1.20/1.20.1.
|
||||
### Currently supporting Minecraft Bedrock 1.20.0 - 1.20.10 and Minecraft Java 1.20/1.20.1.
|
||||
|
||||
## Setting Up
|
||||
Take a look [here](https://wiki.geysermc.org/geyser/setup/) for how to set up Geyser.
|
||||
|
|
|
@ -60,9 +60,6 @@ public final class GameProtocol {
|
|||
private static final PacketCodec DEFAULT_JAVA_CODEC = MinecraftCodec.CODEC;
|
||||
|
||||
static {
|
||||
SUPPORTED_BEDROCK_CODECS.add(Bedrock_v582.CODEC.toBuilder()
|
||||
.minecraftVersion("1.19.80/1.19.81")
|
||||
.build());
|
||||
SUPPORTED_BEDROCK_CODECS.add(Bedrock_v589.CODEC);
|
||||
SUPPORTED_BEDROCK_CODECS.add(DEFAULT_BEDROCK_CODEC);
|
||||
}
|
||||
|
@ -83,10 +80,6 @@ public final class GameProtocol {
|
|||
|
||||
/* Bedrock convenience methods to gatekeep features and easily remove the check on version removal */
|
||||
|
||||
public static boolean isPre1_20(GeyserSession session) {
|
||||
return session.getUpstream().getProtocolVersion() < Bedrock_v589.CODEC.getProtocolVersion();
|
||||
}
|
||||
|
||||
public static boolean isPre1_20_10(GeyserSession session) {
|
||||
return session.getUpstream().getProtocolVersion() < Bedrock_v594.CODEC.getProtocolVersion();
|
||||
}
|
||||
|
|
|
@ -231,11 +231,6 @@ public class UpstreamPacketHandler extends LoggingPacketHandler {
|
|||
stackPacket.getExperiments().add(new ExperimentData("data_driven_items", true));
|
||||
}
|
||||
|
||||
if (GameProtocol.isPre1_20(session)) {
|
||||
stackPacket.getExperiments().add(new ExperimentData("next_major_update", true));
|
||||
stackPacket.getExperiments().add(new ExperimentData("sniffer", true));
|
||||
}
|
||||
|
||||
session.sendUpstreamPacket(stackPacket);
|
||||
break;
|
||||
|
||||
|
|
|
@ -127,51 +127,7 @@ public final class BlockRegistryPopulator {
|
|||
return null;
|
||||
};
|
||||
|
||||
// We are using mappings that directly support 1.20, so this maps it back to 1.19.80
|
||||
BiFunction<String, NbtMapBuilder, String> legacyMapper = (bedrockIdentifier, statesBuilder) -> {
|
||||
if (bedrockIdentifier.endsWith("pumpkin")) {
|
||||
String direction = statesBuilder.remove("minecraft:cardinal_direction").toString();
|
||||
statesBuilder.putInt("direction", switch (direction) {
|
||||
case "north" -> 2;
|
||||
case "east" -> 3;
|
||||
case "west" -> 1;
|
||||
default -> 0; // south
|
||||
});
|
||||
} else if (bedrockIdentifier.endsWith("carpet") && !bedrockIdentifier.startsWith("minecraft:moss")) {
|
||||
String color = bedrockIdentifier.replace("minecraft:", "").replace("_carpet", "");
|
||||
if (color.equals("light_gray")) {
|
||||
color = "silver";
|
||||
}
|
||||
statesBuilder.putString("color", color);
|
||||
return "minecraft:carpet";
|
||||
} else if (bedrockIdentifier.equals("minecraft:sniffer_egg")) {
|
||||
statesBuilder.remove("cracked_state");
|
||||
return "minecraft:dragon_egg";
|
||||
} else if (bedrockIdentifier.endsWith("coral")) {
|
||||
statesBuilder.putString("coral_color", "blue"); // all blue
|
||||
statesBuilder.putBoolean("dead_bit", bedrockIdentifier.startsWith("minecraft:dead"));
|
||||
return "minecraft:coral";
|
||||
} else if (bedrockIdentifier.endsWith("sculk_sensor")) {
|
||||
int phase = (int) statesBuilder.remove("sculk_sensor_phase");
|
||||
statesBuilder.putBoolean("powered_bit", phase != 0);
|
||||
} else if (bedrockIdentifier.endsWith("pitcher_plant")) {
|
||||
statesBuilder.putString("double_plant_type", "sunflower");
|
||||
return "minecraft:double_plant";
|
||||
} else if (bedrockIdentifier.endsWith("pitcher_crop")) {
|
||||
statesBuilder.remove("growth");
|
||||
if (((byte) statesBuilder.remove("upper_block_bit")) == 1){
|
||||
statesBuilder.putString("flower_type", "orchid");
|
||||
return "minecraft:red_flower"; // top
|
||||
}
|
||||
statesBuilder.putBoolean("update_bit", false);
|
||||
return "minecraft:flower_pot"; // bottom
|
||||
}
|
||||
|
||||
return null;
|
||||
};
|
||||
|
||||
ImmutableMap<ObjectIntPair<String>, BiFunction<String, NbtMapBuilder, String>> blockMappers = ImmutableMap.<ObjectIntPair<String>, BiFunction<String, NbtMapBuilder, String>>builder()
|
||||
.put(ObjectIntPair.of("1_19_80", Bedrock_v582.CODEC.getProtocolVersion()), legacyMapper)
|
||||
.put(ObjectIntPair.of("1_20_0", Bedrock_v589.CODEC.getProtocolVersion()), emptyMapper)
|
||||
.put(ObjectIntPair.of("1_20_10", Bedrock_v594.CODEC.getProtocolVersion()), concreteAndShulkerBoxMapper)
|
||||
.build();
|
||||
|
|
|
@ -87,27 +87,7 @@ public class ItemRegistryPopulator {
|
|||
}
|
||||
|
||||
public static void populate() {
|
||||
// Used for the 1.19.80 item palette
|
||||
Map<Item, String> legacyJavaOnly = new HashMap<>();
|
||||
legacyJavaOnly.put(Items.MUSIC_DISC_RELIC, "minecraft:music_disc_wait");
|
||||
legacyJavaOnly.put(Items.PITCHER_PLANT, "minecraft:chorus_flower");
|
||||
legacyJavaOnly.put(Items.PITCHER_POD, "minecraft:beetroot");
|
||||
legacyJavaOnly.put(Items.SNIFFER_EGG, "minecraft:sniffer_spawn_egg"); // the BlockItem of the sniffer egg block
|
||||
|
||||
List<PaletteVersion> paletteVersions = new ArrayList<>(2);
|
||||
paletteVersions.add(new PaletteVersion("1_19_80", Bedrock_v582.CODEC.getProtocolVersion(), legacyJavaOnly, (item, mapping) -> {
|
||||
// Backward-map 1.20 mappings to 1.19.80
|
||||
String id = item.javaIdentifier();
|
||||
if (id.endsWith("pottery_sherd")) {
|
||||
return mapping.withBedrockIdentifier(id.replace("sherd", "shard"));
|
||||
} else if (id.endsWith("carpet") && !id.startsWith("minecraft:moss")) {
|
||||
return mapping.withBedrockIdentifier("minecraft:carpet");
|
||||
} else if (id.endsWith("coral")) {
|
||||
return mapping.withBedrockIdentifier("minecraft:coral");
|
||||
}
|
||||
|
||||
return mapping;
|
||||
}));
|
||||
paletteVersions.add(new PaletteVersion("1_20_0", Bedrock_v589.CODEC.getProtocolVersion()));
|
||||
paletteVersions.add(new PaletteVersion("1_20_10", Bedrock_v594.CODEC.getProtocolVersion(), Collections.emptyMap(), (item, mapping) -> {
|
||||
// Forward-map 1.20 mappings to 1.20.10
|
||||
|
|
|
@ -1594,11 +1594,6 @@ public class GeyserSession implements GeyserConnection, GeyserCommandSource {
|
|||
startGamePacket.setRewindHistorySize(0);
|
||||
startGamePacket.setServerAuthoritativeBlockBreaking(false);
|
||||
|
||||
if (GameProtocol.isPre1_20(this)) {
|
||||
startGamePacket.getExperiments().add(new ExperimentData("next_major_update", true));
|
||||
startGamePacket.getExperiments().add(new ExperimentData("sniffer", true));
|
||||
}
|
||||
|
||||
upstream.sendPacket(startGamePacket);
|
||||
}
|
||||
|
||||
|
|
Binary file not shown.
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
@ -1 +1 @@
|
|||
Subproject commit fda08c186de979ff89b01d2b66f48daa5e218d01
|
||||
Subproject commit afbf78bbe0b39d0a076a42c228828c12f7f7da90
|
Loading…
Reference in a new issue