Generate vibrations from the player doing the interaction rather than the balloon itself. Fixes #195

This commit is contained in:
Sollace 2023-09-28 21:36:48 +01:00
parent 522d062726
commit 86409d0ea6
No known key found for this signature in database
GPG key ID: E52FACE7B5C773DB

View file

@ -340,7 +340,7 @@ public class AirBalloonEntity extends MobEntity implements EntityCollisions.Comp
}
stack.damage(1, player, p -> p.sendToolBreakStatus(hand));
playSound(USounds.Vanilla.ITEM_FLINTANDSTEEL_USE, 1, 1);
getWorld().emitGameEvent(this, GameEvent.ENTITY_INTERACT, getBlockPos());
getWorld().emitGameEvent(player, GameEvent.ENTITY_INTERACT, getBlockPos());
return ActionResult.SUCCESS;
}
@ -352,7 +352,7 @@ public class AirBalloonEntity extends MobEntity implements EntityCollisions.Comp
}
} else if (stack.isEmpty() && isAscending()) {
setBoostTicks(50);
getWorld().emitGameEvent(this, GameEvent.ENTITY_INTERACT, getBlockPos());
getWorld().emitGameEvent(player, GameEvent.ENTITY_INTERACT, getBlockPos());
}
}
}
@ -369,7 +369,7 @@ public class AirBalloonEntity extends MobEntity implements EntityCollisions.Comp
stack.decrement(1);
}
playSound(USounds.ENTITY_HOT_AIR_BALLOON_EQUIP_CANOPY, 1, 1);
getWorld().emitGameEvent(this, GameEvent.ENTITY_INTERACT, getBlockPos());
getWorld().emitGameEvent(player, GameEvent.ENTITY_INTERACT, getBlockPos());
setDesign(HotAirBalloonItem.getDesign(getWorld(), stack));
return ActionResult.SUCCESS;
}
@ -381,7 +381,7 @@ public class AirBalloonEntity extends MobEntity implements EntityCollisions.Comp
setDesign(BalloonDesign.NONE);
dropItem(UItems.GIANT_BALLOON);
playSound(USounds.ENTITY_HOT_AIR_BALLOON_EQUIP_CANOPY, 1, 1);
getWorld().emitGameEvent(this, GameEvent.ENTITY_INTERACT, getBlockPos());
getWorld().emitGameEvent(player, GameEvent.ENTITY_INTERACT, getBlockPos());
return ActionResult.SUCCESS;
}
@ -391,7 +391,7 @@ public class AirBalloonEntity extends MobEntity implements EntityCollisions.Comp
stack.decrement(1);
}
playSound(USounds.ENTITY_HOT_AIR_BALLOON_EQUIP_BURNER, 0.2F, 1);
getWorld().emitGameEvent(this, GameEvent.ENTITY_INTERACT, getBlockPos());
getWorld().emitGameEvent(player, GameEvent.ENTITY_INTERACT, getBlockPos());
return ActionResult.SUCCESS;
}