无人机会在操控着主手不是遥控器的时候停下
This commit is contained in:
parent
7e59b33c83
commit
3e2a0ede2f
1 changed files with 12 additions and 2 deletions
|
@ -174,12 +174,22 @@ public class DroneEntity extends MobileVehicleEntity implements GeoEntity {
|
|||
|
||||
Player controller = EntityFindUtil.findPlayer(this.level(), this.entityData.get(CONTROLLER));
|
||||
|
||||
|
||||
if (!this.onGround()) {
|
||||
if (controller != null) {
|
||||
ItemStack stack = controller.getMainHandItem();
|
||||
if (stack.is(ModItems.MONITOR.get())) {
|
||||
if (stack.getOrCreateTag().getBoolean("Using") && controller.level().isClientSide) {
|
||||
controller.playSound(ModSounds.DRONE_SOUND.get(), 32, 1);
|
||||
}
|
||||
} else {
|
||||
upInputDown = false;
|
||||
downInputDown = false;
|
||||
forwardInputDown = false;
|
||||
backInputDown = false;
|
||||
leftInputDown = false;
|
||||
rightInputDown = false;
|
||||
}
|
||||
if (!controller.level().isClientSide) {
|
||||
this.level().playSound(null, this.getOnPos(), ModSounds.DRONE_SOUND.get(), SoundSource.AMBIENT, 3, 1);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue