mirror of
https://github.com/Sollace/Unicopia.git
synced 2024-11-27 15:17:59 +01:00
Change interaction events and don't send vibrations when the player is being sneaky
This commit is contained in:
parent
86409d0ea6
commit
1654acc2c9
1 changed files with 16 additions and 5 deletions
|
@ -228,6 +228,7 @@ public class AirBalloonEntity extends MobEntity implements EntityCollisions.Comp
|
|||
|
||||
if (isAscending() && age % 15 + rng.nextInt(5) == 0) {
|
||||
playSound(USounds.ENTITY_HOT_AIR_BALLOON_BURNER_FIRE, 0.2F, 1);
|
||||
getWorld().emitGameEvent(null, GameEvent.FLAP, getBlockPos());
|
||||
}
|
||||
|
||||
if (isLeashed()) {
|
||||
|
@ -340,7 +341,9 @@ 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(player, GameEvent.ENTITY_INTERACT, getBlockPos());
|
||||
if (!player.isSneaky()) {
|
||||
getWorld().emitGameEvent(player, GameEvent.ENTITY_INTERACT, getBlockPos());
|
||||
}
|
||||
return ActionResult.SUCCESS;
|
||||
}
|
||||
|
||||
|
@ -352,7 +355,9 @@ public class AirBalloonEntity extends MobEntity implements EntityCollisions.Comp
|
|||
}
|
||||
} else if (stack.isEmpty() && isAscending()) {
|
||||
setBoostTicks(50);
|
||||
getWorld().emitGameEvent(player, GameEvent.ENTITY_INTERACT, getBlockPos());
|
||||
if (!player.isSneaky()) {
|
||||
getWorld().emitGameEvent(player, GameEvent.ENTITY_INTERACT, getBlockPos());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -369,7 +374,9 @@ public class AirBalloonEntity extends MobEntity implements EntityCollisions.Comp
|
|||
stack.decrement(1);
|
||||
}
|
||||
playSound(USounds.ENTITY_HOT_AIR_BALLOON_EQUIP_CANOPY, 1, 1);
|
||||
getWorld().emitGameEvent(player, GameEvent.ENTITY_INTERACT, getBlockPos());
|
||||
if (!player.isSneaky()) {
|
||||
getWorld().emitGameEvent(player, GameEvent.EQUIP, getBlockPos());
|
||||
}
|
||||
setDesign(HotAirBalloonItem.getDesign(getWorld(), stack));
|
||||
return ActionResult.SUCCESS;
|
||||
}
|
||||
|
@ -381,7 +388,9 @@ 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(player, GameEvent.ENTITY_INTERACT, getBlockPos());
|
||||
if (!player.isSneaky()) {
|
||||
getWorld().emitGameEvent(player, GameEvent.EQUIP, getBlockPos());
|
||||
}
|
||||
return ActionResult.SUCCESS;
|
||||
}
|
||||
|
||||
|
@ -391,7 +400,9 @@ public class AirBalloonEntity extends MobEntity implements EntityCollisions.Comp
|
|||
stack.decrement(1);
|
||||
}
|
||||
playSound(USounds.ENTITY_HOT_AIR_BALLOON_EQUIP_BURNER, 0.2F, 1);
|
||||
getWorld().emitGameEvent(player, GameEvent.ENTITY_INTERACT, getBlockPos());
|
||||
if (!player.isSneaky()) {
|
||||
getWorld().emitGameEvent(player, GameEvent.EQUIP, getBlockPos());
|
||||
}
|
||||
return ActionResult.SUCCESS;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue