From 3edd1e5afd405b0f836b8ea9e9525a1299b710c6 Mon Sep 17 00:00:00 2001 From: pietru Date: Mon, 31 Mar 2025 20:16:53 +0200 Subject: [PATCH] add continious rotation --- .../pietru/cookie_utils/commands/npc_command.java | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/main/java/net/pietru/cookie_utils/commands/npc_command.java b/src/main/java/net/pietru/cookie_utils/commands/npc_command.java index 6339e82..a6c7c46 100644 --- a/src/main/java/net/pietru/cookie_utils/commands/npc_command.java +++ b/src/main/java/net/pietru/cookie_utils/commands/npc_command.java @@ -55,7 +55,7 @@ public class npc_command extends BaseCommand{ try { NpcDef.registered_npc_list.get(Integer.parseInt(arg2)) .change_zone(plr.getZone()) - .change_position(plr.getPosition()) + .change_position(plr.getPosition().cpy()) .send_update(); packet.message = "[Server] Moved npc with ID: %s".formatted(arg2); } catch (Exception ignored) { @@ -65,13 +65,23 @@ public class npc_command extends BaseCommand{ case "myrot": try { NpcDef.registered_npc_list.get(Integer.parseInt(arg2)) - .change_view_dir(plr.getEntity().viewDirection) + .change_view_dir(plr.getEntity().viewDirection.cpy()) .send_update(); packet.message = "[Server] Rotated npc with ID: %s".formatted(arg2); } catch (Exception ignored) { packet.message = "[Server] Failed to parse npc ID: %s".formatted(arg2); } break; + case "myrot_c": + try { + NpcDef.registered_npc_list.get(Integer.parseInt(arg2)) + .change_view_dir(plr.getEntity().viewDirection) + .send_update(); + packet.message = "[Server] Rotating npc with ID: %s".formatted(arg2); + } catch (Exception ignored) { + packet.message = "[Server] Failed to parse npc ID: %s".formatted(arg2); + } + break; case "remove", "del": try { NpcDef.registered_npc_list.get(Integer.parseInt(arg2)).unregister();