From 70987e57110f641ff4f4902352c56d7e96a22c34 Mon Sep 17 00:00:00 2001 From: Alex 'mcmonkey' Goodwin Date: Fri, 27 Aug 2021 22:24:47 -0700 Subject: [PATCH] fix body_yaw - also meta tweaks and vehicle couldMatch patch --- .../com/denizenscript/denizen/events/BukkitScriptEvent.java | 5 ++++- .../java/com/denizenscript/denizen/objects/EntityTag.java | 4 ++-- .../objects/properties/entity/EntityJumpStrength.java | 2 ++ .../denizen/scripts/commands/entity/SpawnCommand.java | 2 ++ .../denizen/nms/v1_17/helpers/EntityHelperImpl.java | 6 +++--- 5 files changed, 13 insertions(+), 6 deletions(-) diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/BukkitScriptEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/BukkitScriptEvent.java index 7b2c312482..2f245807be 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/BukkitScriptEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/BukkitScriptEvent.java @@ -223,9 +223,12 @@ public boolean exactMatchesVehicle(String text) { if (specialEntityMatchables.contains(text)) { return false; } - if (text.startsWith("entity_flagged:") || text.startsWith("player_flagged:") || text.startsWith("npc_flagged:")) { + if (text.startsWith("entity_flagged:")) { return true; } + if (text.startsWith("player_flagged:") || text.startsWith("npc_flagged:")) { + return false; + } if (EntityTag.matches(text)) { EntityTag entity = EntityTag.valueOf(text, CoreUtilities.noDebugContext); if (entity == null) { diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/EntityTag.java b/plugin/src/main/java/com/denizenscript/denizen/objects/EntityTag.java index ec27ef36d5..8d9bc5cf83 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/EntityTag.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/EntityTag.java @@ -1683,7 +1683,7 @@ else if (mtr.angle == BlockFace.EAST) { // @returns EntityTag // @group attributes // @mechanism EntityTag.shooter - // @synonyms arrow_firer,fishhook_shooter,snowball_thrower + // @synonyms EntityTag.arrow_firer,EntityTag.fishhook_shooter,EntityTag.snowball_thrower // @description // Returns the projectile's shooter, if any. // --> @@ -2901,7 +2901,7 @@ public void adjust(Mechanism mechanism) { // @object EntityTag // @name shooter // @input EntityTag - // @synonyms arrow_firer,fishhook_shooter,snowball_thrower + // @synonyms EntityTag.arrow_firer,EntityTag.fishhook_shooter,EntityTag.snowball_thrower // @description // Sets the projectile's shooter. // @tags diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityJumpStrength.java b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityJumpStrength.java index b6c6f6fe11..c2291ac3a5 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityJumpStrength.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityJumpStrength.java @@ -60,6 +60,7 @@ public ObjectTag getObjectAttribute(Attribute attribute) { // @returns ElementTag(Number) // @mechanism EntityTag.jump_strength // @group properties + // @synonyms EntityTag.horse_jump_height // @description // Returns the power of a horse's jump. // Also applies to horse-like mobs, such as donkeys and mules. @@ -79,6 +80,7 @@ public void adjust(Mechanism mechanism) { // @object EntityTag // @name jump_strength // @input ElementTag(Number) + // @synonyms EntityTag.horse_jump_height // @description // Sets the power of the horse's jump. // Also applies to horse-like mobs, such as donkeys and mules. diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/SpawnCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/SpawnCommand.java index 3425c16a19..4a52709e40 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/SpawnCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/SpawnCommand.java @@ -35,6 +35,8 @@ public SpawnCommand() { // @Short Spawns a list of entities at a certain location. // @Group entity // + // @Synonyms summon + // // @Description // Spawn an entity or list of entities at the specified location. // diff --git a/v1_17/src/main/java/com/denizenscript/denizen/nms/v1_17/helpers/EntityHelperImpl.java b/v1_17/src/main/java/com/denizenscript/denizen/nms/v1_17/helpers/EntityHelperImpl.java index 70dd6dd145..53695d7937 100644 --- a/v1_17/src/main/java/com/denizenscript/denizen/nms/v1_17/helpers/EntityHelperImpl.java +++ b/v1_17/src/main/java/com/denizenscript/denizen/nms/v1_17/helpers/EntityHelperImpl.java @@ -519,7 +519,7 @@ else if (entity instanceof LivingEntity) { @Override public float getBaseYaw(Entity entity) { net.minecraft.world.entity.Entity handle = ((CraftEntity) entity).getHandle(); - return ((net.minecraft.world.entity.LivingEntity) handle).yHeadRot; + return ((net.minecraft.world.entity.LivingEntity) handle).yBodyRot; } @Override @@ -535,9 +535,9 @@ public void look(Entity entity, float yaw, float pitch) { while (yaw >= 180.0F) { yaw -= 360.0F; } - livingHandle.yBodyRot = yaw; + livingHandle.yBodyRotO = yaw; if (!(handle instanceof net.minecraft.world.entity.player.Player)) { - livingHandle.yBodyRotO = yaw; + livingHandle.setYBodyRot(yaw); } livingHandle.setYHeadRot(yaw); }