mirror of
https://github.com/GeyserMC/Geyser.git
synced 2024-11-29 03:32:46 +01:00
Misc 1.20 fixes (#3828)
* Update mappings
diff: f69b4db9a6...2989dbd7e1
* 1.20 boat entity variants and remove old check in UpstreamPacketHandler
This commit is contained in:
parent
8b8d6ddb9e
commit
4ab9eb4920
3 changed files with 4 additions and 16 deletions
|
@ -125,8 +125,8 @@ public class BoatEntity extends Entity {
|
|||
public void setVariant(IntEntityMetadata entityMetadata) {
|
||||
variant = entityMetadata.getPrimitiveValue();
|
||||
dirtyMetadata.put(EntityDataTypes.VARIANT, switch (variant) {
|
||||
case 6, 7 -> variant - 1; // Dark oak and mangrove
|
||||
case 5, 8 -> 0; // TODO temp until 1.20. Cherry and bamboo
|
||||
case 6, 7, 8 -> variant - 1; // dark_oak, mangrove, bamboo
|
||||
case 5 -> 8; // cherry
|
||||
default -> variant;
|
||||
});
|
||||
}
|
||||
|
|
|
@ -85,8 +85,6 @@ public class UpstreamPacketHandler extends LoggingPacketHandler {
|
|||
return translateAndDefault(packet);
|
||||
}
|
||||
|
||||
private boolean newProtocol = false; // TEMPORARY
|
||||
|
||||
private boolean setCorrectCodec(int protocolVersion) {
|
||||
BedrockCodec packetCodec = GameProtocol.getBedrockCodec(protocolVersion);
|
||||
if (packetCodec == null) {
|
||||
|
@ -125,9 +123,7 @@ public class UpstreamPacketHandler extends LoggingPacketHandler {
|
|||
|
||||
@Override
|
||||
public PacketSignal handle(RequestNetworkSettingsPacket packet) {
|
||||
if (setCorrectCodec(packet.getProtocolVersion())) {
|
||||
newProtocol = true;
|
||||
} else {
|
||||
if (!setCorrectCodec(packet.getProtocolVersion())) {
|
||||
return PacketSignal.HANDLED;
|
||||
}
|
||||
|
||||
|
@ -152,14 +148,6 @@ public class UpstreamPacketHandler extends LoggingPacketHandler {
|
|||
return PacketSignal.HANDLED;
|
||||
}
|
||||
|
||||
// session.getUpstream().getSession().getCodec() == null
|
||||
|
||||
if (!newProtocol) {
|
||||
if (!setCorrectCodec(loginPacket.getProtocolVersion())) { // REMOVE WHEN ONLY 1.19.30 IS SUPPORTED OR 1.20
|
||||
return PacketSignal.HANDLED;
|
||||
}
|
||||
}
|
||||
|
||||
// Set the block translation based off of version
|
||||
session.setBlockMappings(BlockRegistries.BLOCKS.forVersion(loginPacket.getProtocolVersion()));
|
||||
session.setItemMappings(Registries.ITEMS.forVersion(loginPacket.getProtocolVersion()));
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit f69b4db9a6f0e8fff8b29564195c76074210b924
|
||||
Subproject commit 7800f07692d8636a58ac8611ae6fa7b8d3d3a3b3
|
Loading…
Reference in a new issue