Skip to content

Commit

Permalink
未设置headYaw时使用yaw的值
Browse files Browse the repository at this point in the history
  • Loading branch information
lt-name committed Apr 6, 2024
1 parent 8beb401 commit 58c7d2f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>com.smallaswater</groupId>
<artifactId>RsNPC</artifactId>
<version>2.4.4<!-- -SNAPSHOT--></version>
<version>2.4.5-SNAPSHOT</version>

<name>RsNPC</name>
<description>RsNPC -- NPC plugin for Nukkit</description>
Expand Down
6 changes: 5 additions & 1 deletion src/main/java/com/smallaswater/npc/data/RsNpcConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -138,11 +138,15 @@ public RsNpcConfig(@NonNull String name, @NonNull Config config) throws RsNpcCon
if (level == null) {
throw new RsNpcLoadException("世界:" + this.levelName + " 不存在!无法加载当前世界的NPC");
}
double yaw = Utils.toDouble(map.getOrDefault("yaw", 0D));
if (!map.containsKey("headYaw")) {
map.put("headYaw", yaw);
}
this.location = new Location(
Utils.toDouble(map.get("x")),
Utils.toDouble(map.get("y")),
Utils.toDouble(map.get("z")),
Utils.toDouble(map.getOrDefault("yaw", 0D)),
yaw,
0,
Utils.toDouble(map.getOrDefault("headYaw", 0D)),
level
Expand Down

0 comments on commit 58c7d2f

Please sign in to comment.