3
0
Mirror von https://github.com/GeyserMC/Geyser.git synchronisiert 2024-12-26 16:12:46 +01:00

Merge branch 'master' of https://github.com/GeyserMC/Geyser into feature/1.21

Dieser Commit ist enthalten in:
Camotoy 2024-06-16 12:19:32 -04:00
Commit 3b46622ffa
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 7EEFB66FE798081F
3 geänderte Dateien mit 27 neuen und 20 gelöschten Zeilen

Datei anzeigen

@ -34,6 +34,7 @@ import org.cloudburstmc.protocol.bedrock.data.entity.EntityFlag;
import org.cloudburstmc.protocol.bedrock.packet.MoveEntityAbsolutePacket; import org.cloudburstmc.protocol.bedrock.packet.MoveEntityAbsolutePacket;
import org.geysermc.geyser.entity.EntityDefinition; import org.geysermc.geyser.entity.EntityDefinition;
import org.geysermc.geyser.level.block.property.Properties; import org.geysermc.geyser.level.block.property.Properties;
import org.geysermc.geyser.level.block.type.BedBlock;
import org.geysermc.geyser.level.block.type.BlockState; import org.geysermc.geyser.level.block.type.BlockState;
import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.session.GeyserSession;
import org.geysermc.mcprotocollib.protocol.data.game.entity.metadata.EntityMetadata; import org.geysermc.mcprotocollib.protocol.data.game.entity.metadata.EntityMetadata;
@ -125,6 +126,7 @@ public class VillagerEntity extends AbstractMerchantEntity {
int bedRotation = 0; int bedRotation = 0;
float xOffset = 0; float xOffset = 0;
float zOffset = 0; float zOffset = 0;
if (state.block() instanceof BedBlock) {
switch (state.getValue(Properties.HORIZONTAL_FACING)) { switch (state.getValue(Properties.HORIZONTAL_FACING)) {
case SOUTH -> { case SOUTH -> {
bedRotation = 180; bedRotation = 180;
@ -143,6 +145,7 @@ public class VillagerEntity extends AbstractMerchantEntity {
zOffset = .5f; zOffset = .5f;
} }
} }
}
setYaw(yaw); setYaw(yaw);
setPitch(pitch); setPitch(pitch);

Datei anzeigen

@ -35,10 +35,7 @@ import org.cloudburstmc.nbt.util.VarInts;
import org.geysermc.geyser.GeyserImpl; import org.geysermc.geyser.GeyserImpl;
import org.geysermc.geyser.network.GameProtocol; import org.geysermc.geyser.network.GameProtocol;
import java.io.ByteArrayOutputStream; import java.io.*;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import java.net.*; import java.net.*;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
@ -139,6 +136,9 @@ public class GeyserLegacyPingPassthrough implements IGeyserPingPassthrough, Runn
this.geyser.getLogger().debug("Connection timeout for ping passthrough."); this.geyser.getLogger().debug("Connection timeout for ping passthrough.");
} catch (JsonParseException | JsonMappingException ex) { } catch (JsonParseException | JsonMappingException ex) {
this.geyser.getLogger().error("Failed to parse json when pinging server!", ex); this.geyser.getLogger().error("Failed to parse json when pinging server!", ex);
} catch (EOFException e) {
this.pingInfo = null;
this.geyser.getLogger().warning("Failed to ping the remote Java server! Is it online and configured in Geyser's config?");
} catch (UnknownHostException ex) { } catch (UnknownHostException ex) {
// Don't reset pingInfo, as we want to keep the last known value // Don't reset pingInfo, as we want to keep the last known value
this.geyser.getLogger().warning("Unable to resolve remote host! Is the remote server down or invalid?"); this.geyser.getLogger().warning("Unable to resolve remote host! Is the remote server down or invalid?");

Datei anzeigen

@ -27,6 +27,7 @@ package org.geysermc.geyser.translator.level.block.entity;
import org.cloudburstmc.nbt.NbtMap; import org.cloudburstmc.nbt.NbtMap;
import org.cloudburstmc.nbt.NbtMapBuilder; import org.cloudburstmc.nbt.NbtMapBuilder;
import org.geysermc.geyser.level.block.Blocks;
import org.geysermc.geyser.level.block.property.ChestType; import org.geysermc.geyser.level.block.property.ChestType;
import org.geysermc.geyser.level.block.property.Properties; import org.geysermc.geyser.level.block.property.Properties;
import org.geysermc.geyser.level.block.type.BlockState; import org.geysermc.geyser.level.block.type.BlockState;
@ -42,6 +43,9 @@ public class DoubleChestBlockEntityTranslator extends BlockEntityTranslator impl
@Override @Override
public void translateTag(GeyserSession session, NbtMapBuilder bedrockNbt, NbtMap javaNbt, BlockState blockState) { public void translateTag(GeyserSession session, NbtMapBuilder bedrockNbt, NbtMap javaNbt, BlockState blockState) {
if (!(blockState.is(Blocks.CHEST) || blockState.is(Blocks.TRAPPED_CHEST))) {
return;
}
if (blockState.getValue(Properties.CHEST_TYPE) != ChestType.SINGLE) { if (blockState.getValue(Properties.CHEST_TYPE) != ChestType.SINGLE) {
int x = (int) bedrockNbt.get("x"); int x = (int) bedrockNbt.get("x");
int z = (int) bedrockNbt.get("z"); int z = (int) bedrockNbt.get("z");