Skip to content

Commit

Permalink
only do pickup fail effects when holding a portal gun
Browse files Browse the repository at this point in the history
  • Loading branch information
TropheusJ committed Aug 24, 2023
1 parent deff640 commit effc2cc
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import com.fusionflux.portalcubed.entity.CorePhysicsEntity;
import com.fusionflux.portalcubed.entity.TurretEntity;
import com.fusionflux.portalcubed.items.PortalCubedItems;
import com.fusionflux.portalcubed.items.PortalGun;
import com.fusionflux.portalcubed.listeners.NbtSyncable;
import com.fusionflux.portalcubed.sound.PortalCubedSounds;
import com.fusionflux.portalcubed.util.AdvancedEntityRaycast;
Expand Down Expand Up @@ -87,8 +88,11 @@ public static void onGrabKeyPressed(MinecraftServer server, ServerPlayer player,
return;
}
}
player.playNotifySound(PortalCubedSounds.HOLD_FAIL_EVENT, SoundSource.NEUTRAL, 0.3f, 1f);
ServerPlayNetworking.send(player, PortalCubedClientPackets.HAND_SHAKE_PACKET, PacketByteBufs.create());
// bc: only do fail stuff if holding portal gun
if (player.isHolding(stack -> stack.getItem() instanceof PortalGun)) {
player.playNotifySound(PortalCubedSounds.HOLD_FAIL_EVENT, SoundSource.NEUTRAL, 0.3f, 1f);
ServerPlayNetworking.send(player, PortalCubedClientPackets.HAND_SHAKE_PACKET, PacketByteBufs.create());
}
}
});
}
Expand Down

0 comments on commit effc2cc

Please sign in to comment.