From c83fcf75a66c1eb2c45e47aec55518c9e710ce45 Mon Sep 17 00:00:00 2001 From: Alex 'mcmonkey' Goodwin Date: Mon, 6 Jul 2020 06:13:15 -0700 Subject: [PATCH] make attach sync_server apply offset and update faster --- .../denizen/utilities/entity/EntityAttachmentHelper.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/plugin/src/main/java/com/denizenscript/denizen/utilities/entity/EntityAttachmentHelper.java b/plugin/src/main/java/com/denizenscript/denizen/utilities/entity/EntityAttachmentHelper.java index 5b931e76cc..0e461f5495 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/utilities/entity/EntityAttachmentHelper.java +++ b/plugin/src/main/java/com/denizenscript/denizen/utilities/entity/EntityAttachmentHelper.java @@ -53,10 +53,14 @@ public void run() { return; } if (syncServer) { - attached.teleport(to.getLocation()); + Location goal = to.getLocation(); + if (positionalOffset != null) { + goal = fixedForOffset(goal.toVector(), goal.getYaw(), goal.getPitch()).toLocation(goal.getWorld()); + } + attached.teleport(goal); } } - }.runTaskTimer(DenizenAPI.getCurrentInstance(), 20, 20); + }.runTaskTimer(DenizenAPI.getCurrentInstance(), 1, 1); } public void removeFrom(PlayerAttachMap map) {