Skip to content

Commit

Permalink
fix body_yaw - also meta tweaks and vehicle couldMatch patch
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Aug 28, 2021
1 parent c1ea138 commit 70987e5
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 6 deletions.
Expand Up @@ -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) {
Expand Down
Expand Up @@ -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.
// -->
Expand Down Expand Up @@ -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
Expand Down
Expand Up @@ -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.
Expand All @@ -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.
Expand Down
Expand Up @@ -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.
//
Expand Down
Expand Up @@ -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
Expand All @@ -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);
}
Expand Down

0 comments on commit 70987e5

Please sign in to comment.