3
0
Mirror von https://github.com/GeyserMC/Geyser.git synchronisiert 2024-11-19 14:30:17 +01:00

Bed block sanity check for villagers

Dieser Commit ist enthalten in:
Camotoy 2024-06-13 14:58:39 -04:00
Ursprung 746be566a2
Commit 4a334a2c8d
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 7EEFB66FE798081F

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);