Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ public Vector3f bedrockRotation() {
Vector3f fwd = combined.rotate(0f, 0f, 1f);
float yawDeg = (float) Math.toDegrees(Math.atan2(-fwd.getX(), fwd.getZ()));
float pitchDeg = (float) Math.toDegrees(Math.asin(MathUtils.clamp(fwd.getY(), -1f, 1f)));
yawDeg += getYaw();
yawDeg += getYaw() + GeyserDisplayEntity.getExtension().getConfigManager().getYawOffset();
yawDeg = MathUtils.wrapDegrees(yawDeg);
return Vector3f.from(pitchDeg, yawDeg, yawDeg);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ public class ConfigManager {
private Set<String> hideCustomTypes = Set.of();
private boolean hideUnmappedVanilla = true;
private boolean logDisplays = false;
private float yawOffset = 0f;

public ConfigManager(GeyserDisplayEntity extension) {
this.extension = extension;
Expand All @@ -38,6 +39,7 @@ public void load() {
this.hideCustomTypes = config.contains("hide-custom-types") ? new HashSet<>(config.getStringList("hide-custom-types")) : this.hideTypes;
this.hideUnmappedVanilla = !config.contains("hide-unmapped-vanilla-displays") || config.getBoolean("hide-unmapped-vanilla-displays");
this.logDisplays = config.getBoolean("settings.debug.log-displays");
this.yawOffset = (float) config.getDouble("general.yaw-offset");

if (!Files.exists(GeyserDisplayEntity.getExtension().dataFolder().resolve("Entities"))) {
FileUtils.createFiles(GeyserDisplayEntity.getExtension(), "Entities/item-displays.yml");
Expand Down Expand Up @@ -109,4 +111,8 @@ public boolean isHideUnmappedVanilla() {
public boolean isLogDisplays() {
return logDisplays;
}

public float getYawOffset() {
return yawOffset;
}
}
2 changes: 2 additions & 0 deletions src/main/resources/Extension/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ general:
height: 1.7
# The y-offset of display entity
y-offset: -0.5
# Extra yaw rotation (degrees) added to display entities on Bedrock. 180 = flip to face the other way.
yaw-offset: 180.0
# Use entity scale, instead of entity properties
vanilla-scale: false
vanilla-scale-multiplier: 1
Expand Down