mirror of
https://github.com/Sollace/Unicopia.git
synced 2024-11-23 21:38:00 +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) {
|
if (isAscending() && age % 15 + rng.nextInt(5) == 0) {
|
||||||
playSound(USounds.ENTITY_HOT_AIR_BALLOON_BURNER_FIRE, 0.2F, 1);
|
playSound(USounds.ENTITY_HOT_AIR_BALLOON_BURNER_FIRE, 0.2F, 1);
|
||||||
|
getWorld().emitGameEvent(null, GameEvent.FLAP, getBlockPos());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isLeashed()) {
|
if (isLeashed()) {
|
||||||
|
@ -340,7 +341,9 @@ public class AirBalloonEntity extends MobEntity implements EntityCollisions.Comp
|
||||||
}
|
}
|
||||||
stack.damage(1, player, p -> p.sendToolBreakStatus(hand));
|
stack.damage(1, player, p -> p.sendToolBreakStatus(hand));
|
||||||
playSound(USounds.Vanilla.ITEM_FLINTANDSTEEL_USE, 1, 1);
|
playSound(USounds.Vanilla.ITEM_FLINTANDSTEEL_USE, 1, 1);
|
||||||
|
if (!player.isSneaky()) {
|
||||||
getWorld().emitGameEvent(player, GameEvent.ENTITY_INTERACT, getBlockPos());
|
getWorld().emitGameEvent(player, GameEvent.ENTITY_INTERACT, getBlockPos());
|
||||||
|
}
|
||||||
return ActionResult.SUCCESS;
|
return ActionResult.SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -352,10 +355,12 @@ public class AirBalloonEntity extends MobEntity implements EntityCollisions.Comp
|
||||||
}
|
}
|
||||||
} else if (stack.isEmpty() && isAscending()) {
|
} else if (stack.isEmpty() && isAscending()) {
|
||||||
setBoostTicks(50);
|
setBoostTicks(50);
|
||||||
|
if (!player.isSneaky()) {
|
||||||
getWorld().emitGameEvent(player, GameEvent.ENTITY_INTERACT, getBlockPos());
|
getWorld().emitGameEvent(player, GameEvent.ENTITY_INTERACT, getBlockPos());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return ActionResult.PASS;
|
return ActionResult.PASS;
|
||||||
}
|
}
|
||||||
|
@ -369,7 +374,9 @@ public class AirBalloonEntity extends MobEntity implements EntityCollisions.Comp
|
||||||
stack.decrement(1);
|
stack.decrement(1);
|
||||||
}
|
}
|
||||||
playSound(USounds.ENTITY_HOT_AIR_BALLOON_EQUIP_CANOPY, 1, 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));
|
setDesign(HotAirBalloonItem.getDesign(getWorld(), stack));
|
||||||
return ActionResult.SUCCESS;
|
return ActionResult.SUCCESS;
|
||||||
}
|
}
|
||||||
|
@ -381,7 +388,9 @@ public class AirBalloonEntity extends MobEntity implements EntityCollisions.Comp
|
||||||
setDesign(BalloonDesign.NONE);
|
setDesign(BalloonDesign.NONE);
|
||||||
dropItem(UItems.GIANT_BALLOON);
|
dropItem(UItems.GIANT_BALLOON);
|
||||||
playSound(USounds.ENTITY_HOT_AIR_BALLOON_EQUIP_CANOPY, 1, 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());
|
||||||
|
}
|
||||||
return ActionResult.SUCCESS;
|
return ActionResult.SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -391,7 +400,9 @@ public class AirBalloonEntity extends MobEntity implements EntityCollisions.Comp
|
||||||
stack.decrement(1);
|
stack.decrement(1);
|
||||||
}
|
}
|
||||||
playSound(USounds.ENTITY_HOT_AIR_BALLOON_EQUIP_BURNER, 0.2F, 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;
|
return ActionResult.SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue